Modal dialog wrongly closed by escape key
Created by: tomhicks
This might be a browser issue to do with how keyboard events are emitted, but anyway...
To reproduce (in Chrome, not tried other browsers):
- Go to the Bootstrap JavaScript page (http://getbootstrap.com/javascript/#modals) and the modal Live Demo.
- Click the button to open the modal, and wait until it is shown
- Press Ctrl-S and wait for the browser's Save dialog to be shown
- Press and hold the Escape key (the Save dialog will close)
- 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?