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

// cc @narqo @dfilatov 
I think it's very specific. At least, I was faced with it only here.