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

Modal dialog wrongly closed by escape key #13929

Closed
tomhicks opened this issue Jun 26, 2014 · 3 comments
Closed

Modal dialog wrongly closed by escape key #13929

tomhicks opened this issue Jun 26, 2014 · 3 comments

Comments

@tomhicks
Copy link

This might be a browser issue to do with how keyboard events are emitted, but anyway...

To reproduce (in Chrome, not tried other browsers):

  1. Go to the Bootstrap JavaScript page (http://getbootstrap.com/javascript/#modals) and the modal Live Demo.
  2. Click the button to open the modal, and wait until it is shown
  3. Press Ctrl-S and wait for the browser's Save dialog to be shown
  4. Press and hold the Escape key (the Save dialog will close)
  5. Release the escape key

Expected behavior:
The dialog should not close

Actual behavior:
The dialog closes.

This is not just when you hold the escape key down for a long time - it'll happen with a normal press. I presume the escape key listener is on keyup, causing this behavior?

@cvrebert cvrebert added the js label Jun 26, 2014
@cvrebert cvrebert added this to the v3.2.1 milestone Jun 26, 2014
@hnrch02
Copy link
Collaborator

hnrch02 commented Jun 26, 2014

Somewhat related to #13816. Seems like a decent decision to move away from *up in general and move to *down.

@cvrebert
Copy link
Collaborator

Confirmed in v3.2.0 in Firefox & Chrome on OS X.

@dvdliao
Copy link

dvdliao commented Jun 30, 2014

Same issue occurs if escape key is pressed when a select menu is open inside a modal
Expected behavior:
select menu closes and modal dialog stays open
Actual behavior:
modal dialog closes

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

No branches or pull requests

4 participants