Close popover when the user hits escape and fix not calling callbacks on
escape press in modal dialog
Update the query text whenever the dropdown folds.

Currently, if after the user changes the query text, the original select
still matches the query; and if the user chooses the same selection, the
query text will not be overwritten.