flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

destroy tooltip event

Open HPODEV opened this issue 3 years ago • 3 comments

can i destroy tooltip event after show with javascript? https://flowbite.com/docs/components/tooltips/#methods

method available only show and hide, but after hide method tooltip out every

HPODEV avatar Mar 25 '22 10:03 HPODEV

Hey @HPODEV,

We'll add this feature in the next update.

Can you give me a reference (code) on how to destroy it? Do you mean removing the instance of the object completely?

zoltanszogyenyi avatar Mar 25 '22 11:03 zoltanszogyenyi

hi @zoltanszogyenyi , yes completly remove object and event, for example:

  • show tooltip now with .show() method or simple with add data-tooltip- into dom
  • new method destroy() pass element id (when present data-tooltip-target attribute) or id
  • the tooltip should no longer be displayed until I re-execute the show / enable method

I think this method is also indispensable for modals, toast, dropdown, etc ...

KinG-InFeT avatar Mar 25 '22 12:03 KinG-InFeT

any update?

KinG-InFeT avatar May 13 '22 16:05 KinG-InFeT

we need this for every component I have this issue with side-navs

rubenheymans avatar Mar 30 '23 23:03 rubenheymans

Hey peeps,

I've added the destroy() method to the Tooltip object. Will do this for everything else.

Here's the PR if you want to contribute:

https://github.com/themesberg/flowbite/pull/680

This update will also add a global instances object that will allow you to get access to objects created via data attributes.

zoltanszogyenyi avatar Oct 05 '23 09:10 zoltanszogyenyi

Hey everyone!

Flowbite v2.0 fixes this issue by bringing a brand new Instances Manager and the destroy methods.

Please read more about it here:

https://flowbite.com/docs/getting-started/javascript/ https://github.com/themesberg/flowbite/releases/tag/v2.0.0

Cheers, Zoltan

zoltanszogyenyi avatar Oct 26 '23 20:10 zoltanszogyenyi