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

Docs: useTooltip() disabled button 'gotcha' #36

Closed
TheTedAdams opened this issue Feb 17, 2020 · 1 comment
Closed

Docs: useTooltip() disabled button 'gotcha' #36

TheTedAdams opened this issue Feb 17, 2020 · 1 comment

Comments

@TheTedAdams
Copy link

Just ran into a fairly nasty bug using useTooltip that I actually tracked down to a react problem, but thought it would be good to include in the docs.

In short: Disabled buttons in react fire mouseenter events (will open the tooltip) but they do NOT fire mouseleave events (the tooltip never goes away!) This can be fixed by applying pointer-events: none; to the disabled button.

Here's a codesandbox illustrating the issue (and solution)

The relevant react issue: facebook/react#4251

An example of react-bootstrap documenting this in their tooltip documentation: https://react-bootstrap.github.io/components/overlays/#overlays-disabled

Just thought it would be good to call this out so nobody else has to get very confused when their tooltips become permanent...

@ryanbuckleyca
Copy link

I had noticed this bug as well and was able to narrow it down to the disabled button, but wasn't sure how to resolve it. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants