Skip to content

Esc key propagates after closing menu #24

@jacobbroberg

Description

@jacobbroberg

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions