Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opened dropdown do not 'eat up' ESC keypresses when autoclosing from ESC. #3475

Open
boltex opened this issue Nov 18, 2019 · 1 comment
Open

Comments

@boltex
Copy link

boltex commented Nov 18, 2019

Bug description:

First off, thanks for your great product. Here is the issue I found with the dropdowns:

Dropdown with auto close on ESC keypress does not stopPropagation nor stopImmediatePropagation for the keyDown event if escape was pressed with an opened dropdown.

I've looked at the autoclose.ts source file, it only does a preventDefault, which will not stop other listeners from triggering. (as stopImmediatePropagation would)

For example, a program may have setup window.addEventListener('keydown', (p_event) => {blablabla}); for doing something on escape, but not if a dropdown was opened. Which it should only close and prevent any other effects happening from this keypress.

This was the default behavior in the old https://angular-ui.github.io/bootstrap/ for angularJS

Is this a know issue? are there any workarounds?

@gpolychronis
Copy link
Contributor

@boltex
The other program is under your control? ngbDropdown provides the method isOpen, which probably can be develop a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants