Skip to content
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 doesn't work on svg element when "interactive = true" #299

Open
SMNaik123 opened this issue Sep 25, 2023 · 1 comment
Open

Tooltip doesn't work on svg element when "interactive = true" #299

SMNaik123 opened this issue Sep 25, 2023 · 1 comment

Comments

@SMNaik123
Copy link

SMNaik123 commented Sep 25, 2023

Sample code ::

<svg :viewBox="0 0 500 400" preserveAspectRatio="xMinYMin meet"> <g> <image v-tippy="{ delay: 100, arrow: true, content: 'Hi I'm a tooltip', interactive: true, trigger: 'click' }" height="18" width="18" xlink:href="/images/flag.svg" /> </g> </svg>

Tooltip works perfectly fine on a native HTML element.
When interactive is set to false, the tooltip renders without any issue.

@KABBOUCHI
Copy link
Owner

@SMNaik123 when you use interactive, it changes the append behavior, and it doesn't work with svgs.

you can fix it, by changing the appendTo, ex:

 <svg viewBox="0 -10 200 20" style="width: 200px">
     <text  v-tippy="{ delay: 100, arrow: true, content: 'Hi \'m a tooltip', appendTo, interactive: true, trigger: 'click' }">
                test
      </text>
 </svg> 
const appendTo = () => document.body

https://vue-tippy.netlify.app/props#appendto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants