From: Chris Rebert Date: Wed, 23 Dec 2015 06:02:57 +0000 (-0700) Subject: Modal: Ignore spurious `focus` event that Firefox fires at `document` when switching... X-Git-Tag: v4.0.0-alpha.3~468^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d12ed5520e5501207baf8089a5f1711cd06d863d;p=thirdparty%2Fbootstrap.git Modal: Ignore spurious `focus` event that Firefox fires at `document` when switching back to its tab Fixes #18365 Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1228802 --- diff --git a/js/src/modal.js b/js/src/modal.js index d408850201..202c5fe94c 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -259,8 +259,9 @@ const Modal = (($) => { $(document) .off(Event.FOCUSIN) // guard against infinite focus loop .on(Event.FOCUSIN, (event) => { - if (this._element !== event.target && - (!$(this._element).has(event.target).length)) { + if (document !== event.target && + this._element !== event.target && + (!$(this._element).has(event.target).length)) { this._element.focus() } })