]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Modal: Ignore spurious `focus` event that Firefox fires at `document` when switching... 18638/head
authorChris Rebert <code@chrisrebert.com>
Wed, 23 Dec 2015 06:02:57 +0000 (23:02 -0700)
committerChris Rebert <code@chrisrebert.com>
Wed, 23 Dec 2015 06:08:03 +0000 (23:08 -0700)
Fixes #18365
Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1228802

js/src/modal.js

index d408850201549f0c2ec9937e0ac38249e88ec2f6..202c5fe94ca5f3da85a0e0e7b0254c45823381c7 100644 (file)
@@ -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()
           }
         })