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

close #1134
// cc @narqo @dfilatov 
Yep, but it shouldn't be expensive.