Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EnterLeaveEventPlugin] Fix bug when dealing with unhandled DOM nodes #17006

Merged
merged 1 commit into from
Oct 3, 2019

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Oct 3, 2019

This PR is a follow up to #16928, where that PR fixed one class of bug, but also introduced another issue whilst doing so.

This PR introduces an alternative fix that avoids the issue introduced in that PR. Notably, when a DOM node has not been handled by React (it hasn't got an internal handle to a fiber), then the target fiber ends up not matching 1:1, meaning the logic in #16928 is not quite accurate as nativeEventTarget !== fromNode is a valid code path. This PR fixes it by tracking the nativeEvent between calls to this EnterLeaveEventPlugin – to ensure we don't duplicate enter events for the same native event object.

I've added a test case and validated it fixes the issue internally too.

@sizebot
Copy link

sizebot commented Oct 3, 2019

No significant bundle size changes to report.

Generated by 🚫 dangerJS against bc179d0

@trueadm trueadm merged commit 26ba38a into facebook:master Oct 3, 2019
@trueadm trueadm deleted the mouseenterleave-bug branch October 3, 2019 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants