-
Notifications
You must be signed in to change notification settings - Fork 47k
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
onMouseEnter triggered on children in React 16 #11152
Comments
This sounds like a duplicate of #10906. |
Thanks Dan. I had seen the issue but the jsFiddle example seemed like a different cause. |
Let’s keep it open then. I have a suspicion they might be related, but I could be wrong. |
Fixed by #11164. |
React |
Hey @gaearon this works now :) Thanks! |
Hi, I'm having an issue with
onMouseEnter
being triggered on children of a component. It only occurs with React 16.I've created a CodePen that shows the issue.
Simplified structure is as below:
<Card />
is a component that needs to captureonMouseMove
events (and trigger arender
) and<Cover/>
is a simple component that waits for an image (passed as aprop
) to be loaded before displaying it (usingonload
on anImage
created in theconstructor
).If you open the console, you'll see that
onMouseEnter
is triggered when hovering<Card />
(normal behavior), but also when hovering the.text
div (which is not supposed to happen).If you remove the whole
onload
logic from the<Cover/>
element, thenonMouseEnter
works as intended.It's possible that I'm coding this in a way that isn't appropriate, but it does look like a bug anyway :)
The text was updated successfully, but these errors were encountered: