-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Search keywords
tooltip trigger persist click hover
Latest version
- I have tested the latest version
Summary
Hi
I'm looking for a way to control the state and position of the tooltip via click instead of hover.
For example, in a PieChart, I’d like the tooltip to “freeze” when clicking on a slice — keeping its current position and content visible.
This would also enable adding interactive elements (e.g., buttons, links, or custom UI) inside the tooltip itself.
Currently, there doesn’t seem to be a way to control the tooltip’s open state programmatically or trigger it via click.
I’ve tried using the popper modifiers to capture the last popper position and save it on click, then passing that position as anchorEl.
Unfortunately, it seems that the ChartTooltipContainer overrides both the anchorEl and modifiers internally:
| anchorEl={anchorEl} |
I’d really appreciate any guidance or suggestions on how this might be achievable with the current setup, or if there’s a recommended workaround.
Examples
Here’s a short video describing the outcome I’m aiming for: