]> source.dussan.org Git - jquery.git/commit
Event: Use only one focusin/out handler per matching window & document
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Mon, 6 Apr 2020 18:34:40 +0000 (20:34 +0200)
committerGitHub <noreply@github.com>
Mon, 6 Apr 2020 18:34:40 +0000 (20:34 +0200)
commit9e15d6b469556eccfa607c5ecf53b20c84529125
tree5ab7cd218af745a872248083d13069ca11e0ab4c
parent966a70909019aa09632c87c0002c522fa4a1e30e
Event: Use only one focusin/out handler per matching window & document

The `doc` variable in:
https://github.com/jquery/jquery/blob/3.4.1/src/event/focusin.js#L30
matched `document` for `document` & `window` for `window`, creating two
separate wrapper event handlers & calling handlers twice if at least one
`focusout` or `focusin` handler was attached on *both* `window` & `document`,
or on `window` & another regular node.

Also, fix the "focusin from an iframe" test to actually verify the behavior
from commit 1cecf64e5aa415367a7dae0b55c2dd17b591442d - the commit that
introduced the regression - to make sure we don't regress on either front.

Fixes gh-4652
Closes gh-4656
src/event/focusin.js
test/unit/event.js