Skip to content

Bug: onMouseEnter behavior when mouse does not enter via boundary is inconsistent between browsers #21991

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

Closed
saperdadsk opened this issue Jul 29, 2021 · 5 comments
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@saperdadsk
Copy link

saperdadsk commented Jul 29, 2021

React version: 17.0.2

Steps To Reproduce

  1. Create two components Foo and Bar inside a parent Component, where Foo is positioned such that it covers Bar.
  2. Add a onMouseEnter event handler to Bar
  3. Add a click handler to Foo that will cause Foo to be removed when clicked
  4. Click Foo
  5. Mouse is now hovering over Bar

Link to code example:

https://codesandbox.io/s/tender-sun-i1ccy?file=/public/index.html

The current behavior

In Chrome:
The onMouseEnter event handler on Bar is not fired when Foo is removed.
In Firefox:
The onMouseEnter event handler on Bar is fired when Foo is removed.

The expected behavior

onMouseEnter is fired on Bar is fired when Foo is removed. This is the behavior in both chrome and firefox when plain html and js are used:

Spec for MouseEvent seems vague about this issue:

A user agent MUST dispatch this event when a pointing device is moved onto the boundaries of an element or one of its descendent elements. A user agent MUST also dispatch this event when the element or one of its descendants moves to be underneath the primary pointing device.

I saw #2621, though it isn't quite the same issue.
Also saw the stack-overflow issue https://stackoverflow.com/q/55836826, which reported this behavior

Chrome version: Version 92.0.4515.107 (Official Build) (x86_64)
Firefox version: 90.0.2 (64-bit)
OS: MacOs 11.2.3 (20D91)

@saperdadsk saperdadsk added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Jul 29, 2021
@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Jan 9, 2022
@Thummer
Copy link

Thummer commented Sep 28, 2022

I had the same problem recently with [email protected], I tried it using [email protected], it seems like this issue has been fixed.
https://codesandbox.io/s/pedantic-brahmagupta-hbo0tp?file=/package.json:189-195

@stale stale bot removed the Resolution: Stale Automatically closed due to inactivity label Sep 28, 2022
@Elmaranin
Copy link

Even plain behavior doesn't work on Safari without mouseMove event

Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Apr 10, 2024
Copy link

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Stale Automatically closed due to inactivity Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants