mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-21 13:24:08 +03:00
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
This commit is contained in:
+3
-2
@@ -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()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user