popup: closes when user clicks button or some inputs via spacebar (close #1134)

// cc @narqo @dfilatov 
Couldn't we add `pointerclick` listener here as well?