diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2023-03-27 21:22:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-27 21:22:38 +0200 |
commit | ce60d31893deab7d3da592b5173e90b5d50e7732 (patch) | |
tree | e1373262623de3b80867669f397513e48246c974 /src/data | |
parent | 992a1911d0b6195012edc25fd5a48810d4be64b5 (diff) | |
download | jquery-ce60d31893deab7d3da592b5173e90b5d50e7732.tar.gz jquery-ce60d31893deab7d3da592b5173e90b5d50e7732.zip |
Event: Simulate focus/blur in IE via focusin/focusout
In IE (all versions), `focus` & `blur` handlers are fired asynchronously
but `focusin` & `focusout` are run synchronously. In other browsers, all
those handlers are fired synchronously. Asynchronous behavior of these
handlers in IE caused issues for IE (gh-4856, gh-4859).
We now simulate `focus` via `focusin` & `blur` via `focusout` in IE to avoid
these issues. This also let us simplify some tests.
This commit also simplifies `leverageNative` - with IE now using `focusin`
to simulate `focus` and `focusout` to simulate `blur`, we don't have to deal
with async events in `leverageNative`. This also fixes broken `focus` triggers
after first triggering it on a hidden element - previously, `leverageNative`
assumed that the native `focus` handler not firing after calling the native
`focus` method meant it would be handled later, asynchronously, which
was not the case (gh-4950).
Fixes gh-4856
Fixes gh-4859
Fixes gh-4950
Closes gh-5223
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Diffstat (limited to 'src/data')
0 files changed, 0 insertions, 0 deletions