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
Tooltip on mobile should go away when I tap outside of canvas #7738
Comments
Does that happen in master too? (https://www.chartjs.org/samples/master/tooltips/custom-line.html) |
@kurkle works as expected in Chrome. Even |
I was able to reproduce this on iOS Safari. I'll work on making a PR for this |
@ermish any progress? |
Is this still an issue with Safari? |
I could not find a event that FF on mobile emulation would fire on the canvas when tapping outside it. So as a workaround, one would need something like this: if (event.target.tagName !== 'CANVAS') {
const out = new Event('mouseout');
for (const id of Object.keys(Chart.instances)) {
Chart.instances[id].canvas.dispatchEvent(out);
}
} Note: FF on Android mobile does not need a workaround. So I'm not quite sure which devices actually need it. |
Expected Behavior
When I tap outside of a canvas tooltip should disappear, akin to what happens when I tap inside a canvas.
Or similarly to what happens on the desktop when I move mouse away from a circle.
Current Behavior
Tooltip stays visible when I tap outside of a canvas
Steps to Reproduce
Navigate to any tooltip example on mobile phone and tap on any data point.
You will see a tooltip.
Then tap outside of canvas and you will see that tooltip stays on a screen.
Context
It's expected that tooltips and hints are transient elements and they go away as soon as user leaves the context when they appeared.
Environment
The text was updated successfully, but these errors were encountered: