mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-23 18:40:03 +00: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:
parent
0719ab1888
commit
2626eba5f1
@ -289,6 +289,7 @@ const Modal = (($) => {
|
|||||||
if (this._isShown && this._config.keyboard) {
|
if (this._isShown && this._config.keyboard) {
|
||||||
$(this._element).on(Event.KEYDOWN_DISMISS, (event) => {
|
$(this._element).on(Event.KEYDOWN_DISMISS, (event) => {
|
||||||
if (event.which === ESCAPE_KEYCODE) {
|
if (event.which === ESCAPE_KEYCODE) {
|
||||||
|
event.preventDefault()
|
||||||
this.hide()
|
this.hide()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user