Unable to use the same HTML template for multiple tooltips
See original GitHub issueHello,
I have an issue, where I’m unable to use the same HTML template for multiple tooltips.
Here’s my init code:
var poppers = Array.from(document.querySelectorAll('[data-toggle="popper"]'));
tippy(poppers, {
position: 'bottom',
trigger: 'click',
duration: 100,
interactive: true,
arrow: true,
performance: true,
html: document.querySelector('.popper')
});
Only the last [data-toggle="popper"] is able to toggle the tooltip, the first ones just display an empty box.
Any ideas how to fix this? 😃 Popper.js and tippy.js are looking very awesome!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Multiple tippy.js tooltips with html content - Stack Overflow
js. This content varies - it might me just image or text formatted with HTML tags or text + image(s). How can I...
Read more >Tooltips with rich HTML content – amCharts 4 Documentation
Let's start with a pretty basic chart with multiple line series, a cursor, and a tooltipText set for the last series, that consolidates...
Read more >Bootstrap Tooltips - examples & tutorial
Bootstrap Tooltip displays informative text when users hover, focus, or tap an element. They display text tips next to the element in question....
Read more >How to Create an HTML Tooltip [+ Code Templates]
There are several ways to create a tooltip with pure HTML and CSS. In this section, we'll explain a few methods, as well...
Read more >Tooltips - Bootstrap
Documentation and examples for adding custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-attributes for local title ...
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 Free
Top 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

Alright, I’ve simplified the hell out of the
Creating HTML Templatessection. That was really wordy and hard to read before. Now I’ve simplified it and explicitly noted the two options.https://atomiks.github.io/tippyjs/#creating-html-templates
I kind of stumbled upon this and debugged this the hard way just a few weeks ago (new to using tippy.js by maybe about a month now). I was going to suggest a fix for it but there’s a workaround: use
Node.cloneNode(true).It’s not written in the docs, but the template you’re referring to (‘.popper’) is being taken away from the DOM. Check it out in your project.
@atomiks the long term fix is to either handle the cloning of the node internally or update the docs to describe this behavior.
Hope this helps @raineluntta.