]> source.dussan.org Git - jquery.git/commit
Event: Don't crash if an element is removed on blur
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Mon, 19 Oct 2020 19:17:51 +0000 (21:17 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Oct 2020 19:17:51 +0000 (21:17 +0200)
commit5c2d08704e289dd2745bcb0557b35a9c0e6af4a4
treeeb5fb38fac065c649ec94bae2b0130bc4a6197b6
parenta503c691dc06c59acdafef6e54eca2613c6e4032
Event: Don't crash if an element is removed on blur

In Chrome, if an element having a `focusout` handler is blurred by
clicking outside of it, it invokes the handler synchronously. If
that handler calls `.remove()` on the element, the data is cleared,
leaving private data undefined. We're reading a property from that
data so we need to guard against this.

Fixes gh-4417
Closes gh-4799
src/event.js
test/unit/event.js