canonical / react-components

A set of components based on Vanilla Framework
https://canonical.github.io/react-components
95 stars 51 forks source link

Show tooltips after slight delay #975

Closed huwshimi closed 9 months ago

huwshimi commented 1 year ago

Currently tooltips appear instantly, however this causes them to appear while you're moving your mouse past an element, sometimes causing the tooltip to block what you want to click on, and requiring the user to do a little dance to get to the right element.

Screen Recording 2023-09-12 at 2 40 11 pm

We could introduce a very small delay that requires the user to pause on an element before the tooltip appears.

Prateek32177 commented 10 months ago

Hi @huwshimi Can i work on this?

Do you need a hardcoded delay or a delay prop is required which gives additonal customisation for user to utilize the prop to set custom delay for opening the portal? addition to delay do we need to give immediate portal opening option also or only with delay is fine?

huwshimi commented 10 months ago

Hi @huwshimi Can i work on this?

Sure!

Do you need a hardcoded delay or a delay prop is required which gives additonal customisation for user to utilize the prop to set custom delay for opening the portal?

By default I think the delay should be set in the few hundred milliseconds range, but I think it would be good to have a prop to allow changing the delay length.

addition to delay do we need to give immediate portal opening option also or only with delay is fine?

I think the delay should be able to be disabled. I think this could be done using the delay length prop (above) e.g. delay={0}.

akmittal commented 10 months ago

Hi @huwshimi

I have created a PR to fix this https://github.com/canonical/react-components/pull/998. I am using default delay of 500ms.