flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

Tooltips triggerType "manual"

Open danielxbauer opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. I would like to show a tooltip only when I explicitly call the show/hide method in the Tooltip instance. Currently there are two triggerTypes: hover and click. If none of those two is set the default is hover. There is no option (as far as I know) to stop the auto showing/hiding on certain events.

Describe the solution you'd like A third triggerType option called manual or none. The default behavior would be that the tooltip is only displayed when you call it programmatically using the show method.

Describe alternatives you've considered I could create my own Tooltip/Wrapper class where I could implement it in the desired way.

Additional context https://flowbite.com/docs/components/tooltips/#methods

danielxbauer avatar Jun 29 '22 13:06 danielxbauer

Possible code change to make it possible:

tooltip.js > _getTriggerEvents method

case 'none':
  return {
    showEvents: [],
    hideEvents: []
  }

danielxbauer avatar Jun 30 '22 07:06 danielxbauer

This is a good idea that we could use for other components as well (ie. popovers). Will find a solution for v1.6.0.

zoltanszogyenyi avatar Dec 07 '22 10:12 zoltanszogyenyi

Hey @danielxbauer,

I've introduced the none option via this commit (https://github.com/themesberg/flowbite/commit/2689df5e05b46805766a3498f7e3502a885495ca) and this will be released as of v1.6.3.

Cheers, Zoltan

zoltanszogyenyi avatar Jan 20 '23 09:01 zoltanszogyenyi