-
-
Notifications
You must be signed in to change notification settings - Fork 378
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
Inconsistent behavior of tooltip on disabled buttons #471
Comments
Looks like <button
disabled
onMouseEnter={() => console.log("enter")}
onMouseLeave={() => console.log("leave")}
>
Button
</button>
Not sure if it's a bug on React or something. The right behavior is to not fire any of these events. That's the way the DOM works when you use One solution we could do on our side would be using |
I've opened an issue on React: facebook/react#17229 By the way, temporarily, you can fix it by grabbing the <TooltipReference {...tooltip}>
{({ onMouseEnter, onMouseLeave, ...props }) => (
<button onMouseOver={onMouseEnter} onMouseOut={onMouseLeave} {...props}>
Button
</button>
)}
</TooltipReference> Things to note:
|
@edwincoronado @diegohaz @btzr-io I have identified the fix to this issue/Bug, just testing it.I am proceeding to it, please let me know if any issues. |
Hey @diegohaz this seems to have regressed in the current reakit version. Same line of code in the v1 branch: https://github.com/ariakit/ariakit/blob/v1/packages/reakit/src/Tabbable/Tabbable.ts#L128 I saw that in the v2 you can solve this by using |
@aguscha333 Try this: <Button disabled focusable style={{ pointerEvents: "auto" }}> |
thanks for the reply, that works but I have to update a lot of snapshot tests that I was trying to avoid. I'll see if I go with that route or with the patch package one |
any update ? |
Hi! I'm also experiencing this bug. The workaround |
🐛 Bug report
Current behavior
Tooltip
on disabled buttons fails to hide properly on chromium based browsers ( chrome, brave...) Tested only on linux.On Firefox works as expected 👍
Steps to reproduce the bug
Provide a repo or sandbox with the bug and describe the steps to reproduce it.
disabled
button.Expected behavior
I'm not sure if this is the intended behavior or if it should just work as expected ( show on hover, hide on click outside or mouse leave etc...)
Possible solution
Should I just hide the tooltip on a disabled component ? what is the popper way to handle this ?
Environment
The text was updated successfully, but these errors were encountered: