Commit d12ed552 authored by Chris Rebert's avatar Chris Rebert
Browse files

Modal: Ignore spurious `focus` event that Firefox fires at `document` when...

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
parent 2c69e0f8
Showing with 3 additions and 2 deletions
+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()
}
})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment