From 2626eba5f1218dc79064598e2f43a30116bd5742 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Sun, 9 Apr 2017 16:19:20 +0100 Subject: [PATCH] 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. --- js/src/modal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/src/modal.js b/js/src/modal.js index 779b9a402f..02d463945b 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -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() } })