#14180 closed bug (fixed)
focusin/out special events don't work cross-window
Reported by: | scottgonzalez | Owned by: | dmethvin |
---|---|---|---|
Priority: | low | Milestone: | 1.11/2.1 |
Component: | event | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The special event implementation for focusin/out refer to the global document
instead of the owner document of the element the event handler is being added to.
Change History (12)
comment:1 Changed 10 years ago by
Component: | unfiled → event |
---|---|
Milestone: | None → 1.10.3/2.0.4 |
Priority: | undecided → low |
Status: | new → open |
comment:2 Changed 10 years ago by
Although...what is the use case for this? If the event is in an iframe it will have to be in the same domain. If the iframe is navigated we will leak the event data.
comment:3 Changed 10 years ago by
jQuery UI dialogs bind to focusin
on the document when a modal dialog is opened. If the user does something like $( otherWindow ).find( "#dialog" ).dialog({ modal: true })
then our event handler is listening on the wrong document.
Leaking data does seem like a concern. But I think this is uncommon enough that if someone runs into this problem and they're leaking a considerable amount of data (what could they possibly be doing with that many event handlers cross document?) it'd be easy enough for them to work around by explicitly unbinding.
comment:4 Changed 10 years ago by
Yeah they'll have to explicitly unbind. For example if the iframe is part of an MVC view that is updated via a bulk .html()
, the jQuery.cleanData()
that precedes it won't venture into the iframe contents and find the attached event.
I'll try my hand at creating a unit test for this but I may give up, focus tests are the most notoriously unreliable.
comment:6 Changed 10 years ago by
Owner: | set to dmethvin |
---|---|
Status: | open → assigned |
comment:7 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fix #14180. Allow cross-frame use of focusin/out. Close gh-1369.
Changeset: 9b6f0745805941a6d7b7c16c02cf56ab00021c82
comment:8 Changed 10 years ago by
Revert "Fix #14180. Allow cross-frame use of focusin/out. Close gh-1369."
This reverts commit 9b6f0745805941a6d7b7c16c02cf56ab00021c82.
Changeset: eca79fbf5b79d85d137a8eb207fcb1431af47d4e
comment:9 Changed 10 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:11 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fix #14180. Allow cross-frame use of focusin/out. Close gh-1369.
Changeset: 1cecf64e5aa415367a7dae0b55c2dd17b591442d
comment:12 Changed 10 years ago by
Ref #14180, let focusin/out work on non-element targets.
Changeset: c2aca17d457d302cb1683f925b9e5ee93f0984ea
This seems easily fixable if we use data on the
document
rather than a single variable in the closure.