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

Drag mode hides tooltips, but not custom tooltips #298

Closed
jledentu opened this issue Nov 19, 2019 · 2 comments · Fixed by #495
Closed

Drag mode hides tooltips, but not custom tooltips #298

jledentu opened this issue Nov 19, 2019 · 2 comments · Fixed by #495
Labels

Comments

@jledentu
Copy link
Collaborator

Hi,

I met some inconsistency between regular/custom tooltips on zoom in drag mode.
If tooltips are enabled, there are hidden during dragging, as you can see in this fiddle (tested in Firefox 70 and Chromium 78), although it's not explicitly handled by the zoom plugin. I think it's because the update call in the mouseover handler.

However, tooltips.custom is called while dragging, as you can see here.

I think we should explicit the behaviour in the plugin?

@etimberg etimberg added the bug label Apr 25, 2021
@etimberg
Copy link
Member

Updated fiddles for v3
Regular tooltip: https://jsfiddle.net/dof9bgzt/
Custom tooltip: https://jsfiddle.net/m28kyL7u/

@jledentu
Copy link
Collaborator Author

As a workaround, I wrote a custom plugin that disables custom tooltips when dragging:

beforeUpdate(chart) {
  chart.tooltip.prevent = !!chart.$zoom._dragZoomStart;
},

And in my tooltip callback, I early return if chart.tooltip.prevent is true. It's a bit ugly, so it would be nice if the plugin disabled tooltips natively. I don't know how to disable tooltips in a given update (by setting the _active property of the tooltip plugin?).

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