themesberg / flowbite-react

Official React components built for Flowbite and Tailwind CSS
https://flowbite-react.com
MIT License
1.77k stars 395 forks source link

Tooltip should have a flag for "interactive". #1290

Open m-tse opened 4 months ago

m-tse commented 4 months ago

Summary

The Tooltip component should have an "interactive" flag, wherein if interactive=True, mousing over the tooltip will keep the tooltip up. Allowing you to select text in the tooltip, or click on a link in the tooltip. If interactive=False, then once the user moves the mouse off the anchoring element, the tooltip will disappear, and there will be no way to interact with the tooltip.

Context

Currently, the Flowbite React Tooltip is always "interactive", and interestingly, the vanilla Flowbite Tooltip is always "non-interactive". Some other component libraries like Material-Tailwind allow the user to specify interactive or not-interactive.

This is a useful feature to have, because if one's UI has a lot of tooltips, then it can become annoying clicking around on things, where you need to navigate the mouse around the tooltip before you can click on the item underneath.

Would be really nice to have--I'm otherwise really liking this library!

m-tse commented 4 months ago

I guess one similar workaround would be to change trigger="click", and then change the cursor of the anchor element to a help sign.