Skip to content
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

Bug: onMouseLeave does not trigger on disabled button #18753

Closed
raunofreiberg opened this issue Apr 27, 2020 · 5 comments
Closed

Bug: onMouseLeave does not trigger on disabled button #18753

raunofreiberg opened this issue Apr 27, 2020 · 5 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@raunofreiberg
Copy link
Contributor

raunofreiberg commented Apr 27, 2020

Derived from #4251 (comment)


React version: 16.13.1

Steps To Reproduce

  1. Hover over the disabled button
  2. See tooltip appear
  3. Hover away from the disabled button
  4. 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)

@raunofreiberg raunofreiberg added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 27, 2020
@facufrastas
Copy link

If you put the button inside a div, event works fine! But I don't know the reason:

      <div onMouseEnter={show} onMouseLeave={hide} style={{ border: "1px solid red"}} >
        <button disabled>
          Hover me!
        </button>
      </div>

@7kms
Copy link

7kms commented May 15, 2020

has been resolved by onPointerEnter and onPointerLeave?

@shanudjn
Copy link

Hi everyone! I am new to open source .If this issue isn't closed, I would like to work on this?

@raunofreiberg
Copy link
Contributor Author

Pointer Events seem to resolve this issue, so I'll be using those going forward. This issue is more related to how browsers handle mouse events, so I'll be closing this.

@doureyd
Copy link

doureyd commented Jul 15, 2020

FYI Using onPointerEnter and onPointerLeave fix the issue but it's not supported by all browsers yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

5 participants