diff options
| author | Chris Rebert <[email protected]> | 2015-12-22 23:02:57 -0700 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2015-12-22 23:08:03 -0700 |
| commit | d12ed5520e5501207baf8089a5f1711cd06d863d (patch) | |
| tree | 6016ba006162ee94119b2931a02dfcfc41777774 /js/src | |
| parent | 2c69e0f810430362bb742bcadfdd3722cf330cb7 (diff) | |
| download | bootstrap-d12ed5520e5501207baf8089a5f1711cd06d863d.tar.xz bootstrap-d12ed5520e5501207baf8089a5f1711cd06d863d.zip | |
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
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() } }) |
