atomiks / tippyjs

Tooltip, popover, dropdown, and menu library
https://atomiks.github.io/tippyjs/
MIT License
11.91k stars 518 forks source link

Tippy creates a duplicate of the element. #987

Closed sujalgoel closed 2 years ago

sujalgoel commented 2 years ago

Bug description

If you hover over the element, it sometimes creates a clone of it.

Reproduction

https://screen-shot.is-inside.me/dWB7Y4S8.gif

atomiks commented 2 years ago

A gif is not a code reproduction

sujalgoel commented 2 years ago

A gif is not a code reproduction

https://codepen.io/sujal-ops-cyber/pen/porvxLb

atomiks commented 2 years ago

You seem to be calling tippy() in the update() function, which means you're creating multiple instances at times. You should only create a single instance (one tippy() call) then update the instance's content instead.

sujalgoel commented 2 years ago

Oh! thanks for helping

sujalgoel commented 2 years ago

I am trying it but how can I edit the content?

sujalgoel commented 2 years ago

I am trying it but how can I edit the content?

can you please tell me?

atomiks commented 2 years ago

https://atomiks.github.io/tippyjs/v6/methods/#setcontent

sujalgoel commented 2 years ago

thanks! it's working now.