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] Tooltip displayed for unmounted component. #1042

Closed
knubie opened this issue Jun 20, 2023 · 3 comments · Fixed by #1043
Closed

[BUG] Tooltip displayed for unmounted component. #1042

knubie opened this issue Jun 20, 2023 · 3 comments · Fixed by #1043
Labels

Comments

@knubie
Copy link

knubie commented Jun 20, 2023

Describe the bug
When an element is set to display a tooltip (e.g. using data-tooltip-id), and that tooltip has a delayShow (e.g. 300ms), when the user triggers the tooltip (by e.g. hovering over the element), but the element is unmounted before the delayShow interval (e.g. after ~200ms), the tooltip for another element (always seems to be the element which is declared first) will be displayed.

Version of Package
v5.14.0

To Reproduce
See repro repo: https://github.com/knubie/react-tooltip-demo
It seems that the mouse should not move before the "phantom" tooltip is displayed.

Expected behavior
When the element is unmounted, no tooltip should be displayed.

Screenshots

tooltip_bug2.mp4

Desktop (please complete the following information if possible or delete this section):

  • OS: macOS
  • Browser firefox
  • Version 114
  • Frameworks React 18.2
@gabrieljablonski
Copy link
Member

Thanks for reporting.

Some timeouts aren't being cleared on unmount. Should work with [email protected]. We'll close this once #1043 gets merged.

Let us know if you see anything else.

@knubie
Copy link
Author

knubie commented Jun 21, 2023

Awesome! Thanks for the quick fix. Just tested it out and it resolves the problem for me.

@gabrieljablonski
Copy link
Member

Available on official release [email protected]

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

Successfully merging a pull request may close this issue.

2 participants