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

js/modal.js

index 5049cccf36933a3ba8ee11e9c2d5feafb0c0ddcf..cba48507a413bf6f4f79b3da5fe354c120c03db3 100644 (file)
     $(document)
       .off('focusin.bs.modal') // guard against infinite focus loop
       .on('focusin.bs.modal', $.proxy(function (e) {
-        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
+        if (document !== event.target &&
+            this.$element[0] !== e.target &&
+            !this.$element.has(e.target).length) {
           this.$element.trigger('focus')
         }
       }, this))