0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

Prevent default for ESC in modal.js

ESC can be used to close modals, but on OS X/macOS this also jumps out
of full-screen mode. `preventDefault` suppresses this.
This commit is contained in:
Patrick H. Lauke 2017-04-09 16:19:20 +01:00
parent 0719ab1888
commit 2626eba5f1

View File

@ -289,6 +289,7 @@ const Modal = (($) => {
if (this._isShown && this._config.keyboard) {
$(this._element).on(Event.KEYDOWN_DISMISS, (event) => {
if (event.which === ESCAPE_KEYCODE) {
event.preventDefault()
this.hide()
}
})