Fix mouseenter handlers fired twice #16928
Merged
Conversation
Details of bundled changes.Comparing: cdbfa50...3fed177 react-dom
|
|
This is a really good fix – I can confirm that this is indeed an issue. Thank you for this fix and the repro cases! |
trueadm
mentioned this pull request
souravbadami
mentioned this pull request
This was referenced
This was referenced
This was referenced
This was referenced
This was referenced
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.


The bug
mouseenter handler gets fired twice, in a component ReactDOM.render-ed in another component.
The bug issue #16763
The reproduction demo https://codesandbox.io/s/hungry-field-kgkli
The cause
For any event happened in ReactDOM.render-ed component in another component.
In function handleTopLevel(bookKeeping) {...}, we'll get two ancestors (at least) for bookKeeping.
It's ok for most of the events, but mouseenter is different.
mouseenter is extracted out from mouseout/mouseover.
When mouseout gets dealt twice in
handleTopLevelin the situation above, mouseenter gets fired twice on the same node.The fix
EnterLeaveEventPlugin.js