`onMouseLeave` can be unreliable in Chrome
See original GitHub issueSee this jsfiddle: https://jsfiddle.net/tvxderw3/
In Chrome, as you quickly move your mouse up and down the list, you’ll notice that some get stuck in the hover state. This works fine in Safari, and works in Chrome if you use a stable key between the hover states. I think mouseout
somehow isn’t firing if the underlying DOM node is replaced by a new one in the same tick, but it’s odd that this is a Chrome-only bug.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:3
- Comments:23 (6 by maintainers)
Top Results From Across the Web
How to prevent mouseleave from firing on right-click in Chrome?
To inspect you can use f12 then select your element by hovering over it. You could stop the onMouseLeave event possible by using ......
Read more >Element: mouseleave event - Web APIs | MDN
The mouseleave event is fired at an Element when the cursor of a pointing device (usually a mouse) is moved out of it....
Read more >Mouseleave only triggering as expected in Chrome
Hello, The following seems to work only in Chrome, and it does not seem ... is not hovering over any ".widget", you will...
Read more >mouseenter and mouseleave events don't fire when an ...
I'm only having problems with mouseleave (mouseenter doesn't concern me as much). If an element is resized to be smaller and the mouse...
Read more >onmouseleave does not fire if you have mutiple elements react
Custom elements can be lazily upgraded on the page and some PRPL patterns rely on this technique. During the upgrade process, a custom...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I managed to “fix” this. I’m doing two things:
display: inline;
, rather block/inline-block.pointer-events: none
to any containers of SVGs inside the element with the listener.Seems to work fine now, the event is fired properly. I do not know why though.
I fixed this by invalidating the hover state between renders