Problem/Motivation
When you add multiple tooltips to a page, for each tooltip that's added, when you activate a tooltip there are actually multiple copies of it (however many that have been added).
Steps to reproduce
- Add 3 tooltips to some content
- View the content in the front-end and activate a tooltip (easiest to do this with "click" functionality so the tooltip doesn't immediately disappear).
- Inspect the page and see that 3 tooltips are actually added and show at once.
We noticed this issue as we had a drop shadow on the tooltips which got increasingly darker the more tips we added because of the layering effect.
Proposed resolution
Update the javascript that triggers the tooltips the tips are only generated once.
The existing js loops through all the tooltips on the page and runs this for each:
tippy('[data-tippy-content]', drupalSettings.ckeditor_tippy);
But it only needs to run that code once to automatically apply to all the [data-tippy-content] items on the page anyway.
Comments
Comment #2
a.hover commentedAttached is a patch to change how the "once" is checked so that the tooltip triggering only runs once.