flowbite
flowbite copied to clipboard
Tooltips triggerType "manual"
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
Possible code change to make it possible:
tooltip.js > _getTriggerEvents method
case 'none':
return {
showEvents: [],
hideEvents: []
}
This is a good idea that we could use for other components as well (ie. popovers). Will find a solution for v1.6.0.
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