React version: 16.13.1
https://codesandbox.io/s/eager-euler-c72fw?file=/src/App.js
mouseenter listener.mouseenter does not fireLink to code example: https://codesandbox.io/s/eager-euler-c72fw?file=/src/App.js
mouseenter does not fire because React calculates mouseenter/leave based on the relative element of the opposing event.
e.g. mouseenter calculated from the mouseout on the button. Browsers do not fire pointer events on disabled elements
mouseenter should fire
Previous issue: https://github.com/facebook/react/issues/4251
@jquense if I comment the SyntheticEvent onMouseEnter(L19).
Native enter is logged from the addEventListener mouseenter event
you don't need to comment it, the native one always fires. It's there to illustrate that React is not mimicking the native behavior correctly
Currently investigating this (and hopefully fixing)
Repro'd via a broken test:
https://github.com/facebook/react/compare/master...ramblinjan:master
EDIT: Actually I have to fix the test. I had the sanity check and the test case backwards. Oops!
EDIT 2: Test is now correctly matched to issue. Moving on to fix.
FWIW there isn't any easy fix for this without changing all the mouse enter/leave event dispatching. I've already posted a few PRs that work around this a few ways but they are many years old at this point. Tbh the easiest fix would be to just use native mouse enter and leave
@jquense I think the problem is that would require attaching a native event listener 1:1 for each synthetic event which is potentially a huge performance hit when you can take advantage of event delegation instead. I think I might have a reasonable fix for this.
Most helpful comment
@jquense I think the problem is that would require attaching a native event listener 1:1 for each synthetic event which is potentially a huge performance hit when you can take advantage of event delegation instead. I think I might have a reasonable fix for this.