-
Notifications
You must be signed in to change notification settings - Fork 233
Description
I use the typeahead (latest build, 9c2b65c) in a modal dialog. When I click the Esc
key the typeahead menu closes, but my modal dialog also closes (because it is set to close when Esc
is clicked.
Since this issue is very similar to the one solved in #13 (which solves the same propagation problem when selecting an entry with the Enter
key), I tried implementing the same for the Esc
key, by adding $e.preventDefault()
and $e.stopPropgation()
in _onEscKeyed()
(see d0371ed). However, this is not enough since my modal dialog binds to the keyUp
event and typeahead only listens for keyDown
.
Any ideas on how this should be solved. In order to truly prevent an Esc
key click to propagate, I do believe typeahead should stop propagation for both keyDown
and keyUp
. Could a solution be to call close()
on keyUp
instead and simply suppress keyDown
- as long as the menu is open of course?