Question about nested tooltips
See original GitHub issueI have tried creating a nested tooltip, but the nested one does not display. I would appreciate any help.
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'/>
<title>Tippy Playground</title>
<style>
html,body {font-family:Roboto,sans-serif;font-size:1em;}
tt {color:royalBlue;font-size:1.4em;}
button {margin:.5em;padding:.5em;}
#box {align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:center;}
.gap {width:2em;}
.help {cursor:help;}
.hide {display:none;}
.nested {border-bottom:2px dotted #333;}
.tippy-tooltip.hs-theme {background-color: #ffecb3;border: .1em solid #ef5350;border-radius: 1em;color: #333;}
.tippy-tooltip.hs-theme[data-animatefill] {background-color:transparent;}
.tippy-tooltip.hs-theme .tippy-backdrop {background-color:#ffecb3;}
.tippy-tooltip.hs-theme[x-placement^='top'] .tippy-arrow {border-top-color:#ef5350;margin-bottom:-.15em;}
.tippy-tooltip.hs-theme[x-placement^='bottom'] .tippy-arrow {border-bottom-color:#ef5350;margin-top:-.15em;}
.tippy-tooltip.hs-theme[x-placement^='left'] .tippy-arrow {border-left-color:#ef5350;margin-right:-.15em;}
.tippy-tooltip.hs-theme[x-placement^='right'] .tippy-arrow {border-right-color:#ef5350;margin-left:-.15em;}
</style>
</head>
<body>
<h3>This is a simple test for Tippy.js tooltips</h3>
<div id='box'>
<button class='t1 help'>Tooltip #1</button>
<button class='t1 help'>Tooltip #1</button>
<span class='gap'></span>
<button class='t2 help'>Tooltip #2</button>
<button class='t2 help'>Tooltip #2</button>
<span class='gap'></span>
<a href="#" class="myTip3 help">Nested</a>
</box>
<div class='hide'>
<main id='myTip1'>
A simple tooltip that contains very basic HTML, but is long enough to cause a line wrap - <tt>something special here</tt>.
</main>
<main id='myTip2'>
This is tip #2.
</main>
<div id="myTip3">
This is a regular tooltip, but with the addition of a <span class='nested help'>nested</span> tooltip.
</div>
<div id="myTip3-nested">
This is a nested tooltip.
</div>
</div>
<script src="https://unpkg.com/popper.js@1"></script>
<script src="https://unpkg.com/tippy.js@4"></script>
<script>
tippy.setDefaults({
allowHTML: true,
animation: 'scale',
arrow: false,
delay: [100, 300],
flip: true,
flipBehavior: ['bottom', 'top'],
interactive: true,
maxWidth: '30em',
multiple: true,
placement: 'bottom-end',
theme: 'hs',
});
tippy.group(
tippy('.t1', {
content: document.querySelector('#myTip1').innerHTML,
placement: 'bottom-start',
})
);
tippy('.t2', {
content: document.querySelector('#myTip2').innerHTML,
});
tippy('.myTip3', {
arrow: true,
content: document.querySelector('#myTip3').innerHTML,
});
tippy('.myTip3 .nested', {
arrow: true,
content: document.querySelector('#myTip3-nested').innerHTML,
});
</script>
</body>
</html>
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (5 by maintainers)
Top Results From Across the Web
Nested tooltip (tooltip within tooltip) - Stack Overflow
I have a page which is having some link and when i click on that link it open a tool tip form that...
Read more >Quick tip: Nested tooltips: Hover "[Could lead to future Events]" to ...
For the longest time I had no idea that [Could lead to future Events] was a valid tooltip target. Figured I'd post about...
Read more >labelling nested data | General Excel Questions & Answers
Hi . . I used the data in the attachment to create this nested sunburst, but I'm having difficulty with (nesting / data...
Read more >Tooltips in tooltips · Philip Ardeljan is a UI designer
A nested tooltip is a great solution. In the context of a complex grand strategy game like CK3, having explanatory text is necessary....
Read more >Tippy Tooltips [Official Support] - Add-ons - Anki Forums
I can try to make the creation of arbitrarily deeply nested tooltips possible and provide you with a more complex template script that...
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
Hey atomik. Is this still the way to nest? I’m looking to create a simple dropdown and the nested items are not showing up using data-template=“”, I have not tryed the above yet as I thought nesting was already included.
This does work with version 4 but does not work on the last version (5). Do you have a solution for the new version?