diff options
| author | Chris Rebert <[email protected]> | 2015-12-24 08:15:27 -0700 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2015-12-24 08:15:27 -0700 |
| commit | d30310feae9129c35136fb91c7fc8bdf95fea47d (patch) | |
| tree | c4a82d9b0513662ee7a632303969e7e1b0fb6a7d /js/src | |
| parent | e2bf1e9fae99f860a0a27e92b0c9f65a2d72cb4a (diff) | |
| parent | d12ed5520e5501207baf8089a5f1711cd06d863d (diff) | |
| download | bootstrap-d30310feae9129c35136fb91c7fc8bdf95fea47d.tar.xz bootstrap-d30310feae9129c35136fb91c7fc8bdf95fea47d.zip | |
Merge pull request #18638 from twbs/fix-18365
Modal: Ignore spurious focus event that Firefox fires at document when switching back to its tab
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/modal.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/modal.js b/js/src/modal.js index d40885020..202c5fe94 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() } }) |
