atomiks / tippyjs

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

Tippy Multiple Instances Issue #1084

Closed halid96 closed 1 year ago

halid96 commented 1 year ago

When I am trying to update Tippy, it creates a new Tippy tooltip for the same element... I tried several ways but didn't manage it to work.

I am using: 'https://unpkg.com/@popperjs/core@2', 'https://unpkg.com/tippy.js@6'

I tried: https://atomiks.github.io/tippyjs/v6/tippy-instance/ https://atomiks.github.io/tippyjs/v6/methods/ ... The .unmount(), .destroy(), and .setProps() methods

Here is my code:

window.update_rating_info_tippy = function(){
      tippy(document.querySelectorAll('#vid-rate'), {
      theme: 'tippy-black',
      placement: 'top',
      arrow: false,
      animation: 'scale',
      content(reference) {
      const template = document.getElementById('vid-rate-tippy');
          return template.innerHTML;
      },
      allowHTML: true,
      interactive: true,
      duration: [100, 100]
      });
};

Whenever I am trying to update it i am calling update_rating_info_tippy() ... It is working but creates a new tooltip, but not deletes the old ones.

dsaewqeqw

HarshaVardhanPVK commented 1 year ago

I am also facing same issue. tippy

atomiks commented 1 year ago

It's documented in the v6 migration guide