diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2023-03-27 21:24:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-27 21:24:42 +0200 |
commit | 59f7b55bf6dad71eee6434116566356d597f1d90 (patch) | |
tree | dc6940dbcb6afc293ef659ef9b6894ed6e3857cd /README.md | |
parent | 4837a95b367faa613105a03fa0cb8b8fc50c02d4 (diff) | |
download | jquery-59f7b55bf6dad71eee6434116566356d597f1d90.tar.gz jquery-59f7b55bf6dad71eee6434116566356d597f1d90.zip |
Event: Simulate focus/blur in IE via focusin/focusout (3.x version)
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).
To preserve relative `focusin`/`focus` & `focusout`/`blur` event order
guaranteed on the 3.x branch, attach a single handler for both events in IE.
A side effect of this is that to reduce size the `event/focusin` module
no longer exists and it's impossible to disable the `focusin` patch
in modern browsers via the jQuery custom build system.
Fixes gh-4856
Fixes gh-4859
Fixes gh-4950
Ref gh-5223
Closes gh-5224
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -95,7 +95,6 @@ Some example modules that can be excluded are: - **dimensions**: The `.width()` and `.height()` methods, including `inner-` and `outer-` variations. - **effects**: The `.animate()` method and its shorthands such as `.slideUp()` or `.hide("slow")`. - **event**: The `.on()` and `.off()` methods and all event functionality. -- **event/focusin**: Cross-browser support for the focusin and focusout events. - **event/trigger**: The `.trigger()` and `.triggerHandler()` methods. - **offset**: The `.offset()`, `.position()`, `.offsetParent()`, `.scrollLeft()`, and `.scrollTop()` methods. - **wrap**: The `.wrap()`, `.wrapAll()`, `.wrapInner()`, and `.unwrap()` methods. |