aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-12-22 23:02:57 -0700
committerChris Rebert <[email protected]>2015-12-22 23:08:03 -0700
commitd12ed5520e5501207baf8089a5f1711cd06d863d (patch)
tree6016ba006162ee94119b2931a02dfcfc41777774
parent2c69e0f810430362bb742bcadfdd3722cf330cb7 (diff)
downloadbootstrap-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
-rw-r--r--js/src/modal.js5
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()
}
})