]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Prevent default for ESC in modal.js 22398/head
authorPatrick H. Lauke <redux@splintered.co.uk>
Sun, 9 Apr 2017 15:19:20 +0000 (16:19 +0100)
committerPatrick H. Lauke <redux@splintered.co.uk>
Sun, 9 Apr 2017 15:19:20 +0000 (16:19 +0100)
ESC can be used to close modals, but on OS X/macOS this also jumps out
of full-screen mode. `preventDefault` suppresses this.

js/src/modal.js

index 779b9a402fdd141d3440c0ed8fdf73d21081ebd5..02d463945b923cda15b8a3e076e6f7f2e36a01de 100644 (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()
           }
         })