Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added 500ms delay before tooltip is closed #7007

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HardikChoudhary24
Copy link
Contributor

@HardikChoudhary24 HardikChoudhary24 commented Nov 4, 2023

What does this PR do?

Fixes #6998

  • Added 500ms delay before tooltip is closed.

Where should the reviewer start?

  • In the stories

What testing has been done on this PR?

  • Ran locally on storybook.

How should this be manually tested?

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • userEvent is used in place of fireEvent.
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

  • Previously, the tooltip would close immediately when the mouse left.

What are the relevant issues?

Screenshots (if appropriate)

Do the grommet docs need to be updated?

Should this PR be mentioned in the release notes?

Is this change backwards compatible or is it a breaking change?

  • yes

@HardikChoudhary24 HardikChoudhary24 changed the title added 300ms delay before tooltip is closed added 500ms delay before tooltip is closed Nov 4, 2023
@jcfilben jcfilben added the PRty Biweekly PR reviews by grommet team with hoping of closing such PRs label Nov 8, 2023
@taysea
Copy link
Collaborator

taysea commented Nov 9, 2023

Thanks for the contribution! I'm thinking about if a timeout is the best approach for this or if there's any way to make the component smarter to know the mouse is in the region between the control and the tip.

For example, APG (an accessibility best practices group through WCAG) has been exploring a pattern that leverages CSS :after selector to have an invisible block for the region between the control and the tip: https://codepen.io/Moiety/pen/LaPvWy

I'm wondering if there's a way to explore a similar approach in Grommet. Right now, the space between the control and the tip is driven by a margin value in the theme. Is there anyway to use that value and incorporate that into the broader "click target" so that if the mouse is a) over the control, b) over the tip, or c) in the space between the tip and control, the tip will remain visible?

@jcfilben jcfilben removed the PRty Biweekly PR reviews by grommet team with hoping of closing such PRs label Nov 9, 2023
@jcfilben jcfilben added the waiting Awaiting response to latest comments label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Awaiting response to latest comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tip - add slight delay before tooltip is closed
3 participants