-
-
Notifications
You must be signed in to change notification settings - Fork 534
[BUG] Adding/removing svg elements breaks tooltip of existing elements #1107
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
Comments
As a workaround, you can force a re-render on the tooltip so that it does the check again. The easiest way in your example is like this: <Tooltip id="my-tooltip" key={visible} /> but you can try other ways. This isn't a fix though, so we'll leave this open for now. |
Thanks for the reply and great library, love the work you're putting in!
My initial thought as well, odd that the first one fails. Since our svg is scattered across various components, passing around the key is a slight pain, our workaround is:
(which I'm not completely certain on why it works). |
@fatton139 I'd have to check, but very likely that works because updating the Glad to know it works for now for your project, and we'll definitely be investigating this. |
If it helps, here is an example outside an SVG: https://codesandbox.io/s/nostalgic-heisenberg-tkz68f?file=/src/App.tsx |
Considering 90% of bugs reported don't include a reproducible example (these are the most fun to debug 🙃🙃🙃), this will be more than enough. Thanks for taking the time. |
Whelp, that's embarassing. Sneaky regression bugs. Feel free to use That's the only change from v5.21.6, so don't worry about the beta tag. Once we do an official release, we'll close this and you should be able to upgrade without trouble. |
For future reference.
This only applies when using |
Happens to the best of us
Tested on our end and works brilliantly! Thanks for the quick resolution! 💖 |
The beta version you mentioned fixed a similar issue for a project I'm working on and we are using the In our case we are adding a new element with tooltip data-attributes after a POST API call, and only the added element would show the tooltip without refresh. |
Fix available on official release |
Uh oh!
There was an error while loading. Please reload this page.
Bug description
Odd one but, when svg elements are added/removed, the existing svg element's tooltips stop working.
Version of Package
v5.21.6
To Reproduce
Reproduction: https://codesandbox.io/s/ecstatic-torvalds-vmy6qm?file=/src/index.tsx
Click the "show" button then hover over the black box, you'll note that the tooltip stops showing up.
There are ways to reproduce it outside svgs but they'll require unconventional code, SVG is the most straightforward way to demo this.
Expected behavior
Tooltip should still show up on the existing svg elements.
Screenshots
See code sandbox reproduction
Thanks!
The text was updated successfully, but these errors were encountered: