Fixed issue where context menu dialogues do not close when escape is
pressed if focus is not on the input element.