Bug: onMouseLeave does not trigger on disabled button
See original GitHub issueDerived from https://github.com/facebook/react/issues/4251#issuecomment-591644826
React version: 16.13.1
Steps To Reproduce
- Hover over the disabled button
- See tooltip appear
- Hover away from the disabled button
- Tooltip does not disappear
Link to code example: https://codesandbox.io/s/gracious-galileo-qymqw?file=/src/App.js
The current behavior
onMouseLeave
is not triggered on disabled button
The expected behavior
onMouseLeave
should be triggered on disabled button
I don’t think #17675 actually made onMouseEnter
not fire on disabled buttons, since in the example that I’ve given, it is firing and using the latest React version (the PR has been shipped in 16.13.0)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
React does not fire onMouseLeave events on a disabled button
In the end I think the best solution will be to simply fake the disabled state of the button instead of actually disabling...
Read more >Mouseenter event not thrown on disabled elements in chrome
I created an Angular directive which automatically disables a button if a certain condition is met. Additionally, a small tooltip ...
Read more >11382 (Mouseenter doesn't fire on a disabled input element)
This was done intentionally in jQuery.event.dispatch based on #6911 to normalize a cross-browser behavior. However it seems inadvisable for us to do it, ......
Read more >trigger | Cypress Documentation
trigger. Trigger an event on a DOM element. It is unsafe to chain further ... off 'cy' cy.clock().trigger('mouseleave') // Errors, 'clock' does not...
Read more >Pointer events - Web APIs | MDN
Note: Pointer events are not available in Web Workers. ... boundaries of an element; firing the pointerup event for a device that does...
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
has been resolved by
onPointerEnter
andonPointerLeave
?FYI Using
onPointerEnter
andonPointerLeave
fix the issue but it’s not supported by all browsers yet.