Tooltips : Does not smooth while moving mouse / touch and on mobile tooltip does not disappeared when touch end
See original GitHub issueExpected Behavior
Bugs :
- Issue#A : It should be smooth when moving mouse (+ touch on mobile)
- Issue#B : It should disapreared tooltips when touch end (mobile) (or wait some secs before disapreared, possible while API ?)
Test / Demo : https://codepen.io/anon/pen/VWbBor
Current Behavior
- Issue#A : Tooltip is jumping (not smooth)
- Issue#B : Tooltip does not disappeared when touch end.
Possible Solution
- Issue#A : Add some delay ? debounce ?
- Issue#B : Add event onTouchEnd = Hide tooltip ?
Steps to Reproduce (for bugs)
Issue#A
- Go to https://codepen.io/anon/pen/VWbBor
- Move mouse between bars (Try both slowly and faster)
- You will see tooltip is jumping
Issue#B
- Go to https://codepen.io/anon/pen/VWbBor (on your mobile)
- Touch or move on/to some bar
- You will see tooltip does not disappeared when touch end.
Context
Config on options
is :
options: {
tooltips: {
enabled: true,
mode: 'index',
intersect: false
}
}
Environment
- Chart.js version: 2.6.0 Latest (https://npmcdn.com/chart.js@latest/dist/Chart.bundle.min.js)
- Browser name and version: Test on both latest Chrome and Firefox on my MacOS
- Link to your project: https://codepen.io/anon/pen/VWbBor
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Bootstrap's tooltip doesn't disappear after button click ...
This is because trigger is not set. The default value for trigger is 'hover focus' , thus the tooltip stay visible after a...
Read more >Tooltips won't vanish when the mouse is no longer over the
Tooltips won't vanish when the mouse is no longer over the - Microsoft Community.
Read more >Designing Better Tooltips For Mobile User Interfaces
In this article, we show you how to design tooltips that will amplify your mobile designs and explain where mobile tooltips are most ......
Read more >Tooltips in the time of WCAG 2.1 | Sarah Higley
To do this, the tooltip should open on focus or mouse over, and closes on blur or mouse out. Combining pointer and keyboard...
Read more >Prototype triggers - Figma Help Center
This triggers the Destination frame when you release the mouse or touch pad. For mobile devices, this is once the user's finger no...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having tested this I’ve discovered that the problem for the jittery animation is when the tooltip settings are:
What happens is that when the mouse moves over the index, the tooltip begins to move. However, the moment the mouse hits the bar (if the tooltip is still moving), the tooltip restarts its animation from the beginning.
It looks like intersect: false probably isn’t being read properly (or at all) wherever the tooltip animation is triggered.
It also looks like the “current index” of the tooltip position doesn’t actually get changed until after the animation is complete, which, in my opinion, is not the correct order to do things in. In fact, this is probably the change that caused the problem and revealed that intersect: false doesn’t get checked in index mode.
NOTE: This also happens on line graphs. If you arrive at the index, the tooltip will move, then if you hit the circle for that data point while it’s moving, the tooltip will restart its movement just as it does in the bar graph.
ALSO NOTE: This issue was introduced by 2.6.0 and isn’t found in 2.5.0.
Okay, in my case adding the following fixed it,
Here is the updated example for issue A mentioned here: https://codepen.io/anon/pen/aVPewe