From: Chris Rebert Date: Wed, 23 Dec 2015 06:21:51 +0000 (-0700) Subject: Modal: Ignore spurious `focus` event that Firefox fires at `document` when switching... X-Git-Tag: v3.3.7~151^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18639%2Fhead;p=thirdparty%2Fbootstrap.git Modal: Ignore spurious `focus` event that Firefox fires at `document` when switching back to its tab Fixes #18365 Ports #18638 to v3 Refs https://bugzilla.mozilla.org/show_bug.cgi?id=1228802 --- diff --git a/js/modal.js b/js/modal.js index 5049cccf36..cba48507a4 100644 --- a/js/modal.js +++ b/js/modal.js @@ -140,7 +140,9 @@ $(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))