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

Consider removing mouseenter/mouseleave polyfill #11972

Open
gaearon opened this Issue Jan 5, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@gaearon
Copy link
Member

gaearon commented Jan 5, 2018

As suggested in #10247.
Not sure we want to do it, but I decided to create an issue to track future attempts (the PR is stale).

@gaearon gaearon changed the title Remove mouseenter/mouseleave polyfill Consider removing mouseenter/mouseleave polyfill Jan 5, 2018

@gaearon gaearon added this to the 17.0.0 milestone Jan 5, 2018

@gaearon

This comment has been minimized.

Copy link
Member

gaearon commented Jan 5, 2018

Also related: #10269

@jquense

This comment has been minimized.

Copy link
Collaborator

jquense commented Jan 5, 2018

The main difficulty with removing the polyfill is the portal support. Unlike all other events, it doesn't fall out naturally from the synthetic event system. #10269 has (i think) the minimum basic code to add portal support back in. The question is whether it's better than the current polyfill /shrug

@aldendaniels

This comment has been minimized.

Copy link

aldendaniels commented May 29, 2018

I was pleasantly surprised that React correctly avoids firing onMouseEnter / onMouseLeave events on ancestors when moving the mouse between a portal host and its content - simulating non-portal behavior. Nice!

It looks like React doesn't have this same fix for focus/blur, but I think it ideally would. It's quite useful to be able to treat portals exactly like any other child, which means that a focusOut event caused by moving focus into a portal wouldn't bubble to portal ancestors.

I think the full list of events that need special handling might be all those that have a relatedTarget - e.g these.

Update: I think this latter bit isn't true, since React always uses onFocusIn/onFocusOut under the hood which do bubble to parents. Perhaps onMouseEnter / onMouseLeave are the only case... There are also pointer and drag events to consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment