Closed oshihirii closed 4 years ago
I currently apply tippy after initial content has loaded with:
tippy('[data-tippy-content]', { followCursor: true, plugins: [followCursor] });
When more content is dynamically added to the page, I want to ensure all content has tippy applied.
I have tried this approach of destroying tippy and re-applying it:
tippy('[data-tippy-content]').destroy(); tippy('[data-tippy-content]', { followCursor: true, plugins: [followCursor] });
But I get error:
Uncaught TypeError: Object(...)(...).destroy is not a function
I am referring to the following docs:
https://atomiks.github.io/tippyjs/v6/methods/#destroy
https://atomiks.github.io/tippyjs/v6/tippy-instance
Thank you.
Since you're passing a string, an array of instances get returned, not an instance directly. So you'd need to use .forEach and destroy each one.
.forEach
I currently apply tippy after initial content has loaded with:
When more content is dynamically added to the page, I want to ensure all content has tippy applied.
I have tried this approach of destroying tippy and re-applying it:
But I get error:
I am referring to the following docs:
https://atomiks.github.io/tippyjs/v6/methods/#destroy
https://atomiks.github.io/tippyjs/v6/tippy-instance
Thank you.