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

fix(TooltipV2): delay tooltip opening time by 50ms #5350

Conversation

francinelucca
Copy link
Member

@francinelucca francinelucca commented Dec 4, 2024

Closes https://github.com/github/primer/issues/4432

Adds a 50ms delay to show the tooltip when triggered via the mouse to prevent showing tooltips when the user is just "passing by"

Changelog

New

  • Set Tooltip event after mouseEnter under a timeout to prevent opening when the mouse is just "passing by"

Changed

  • use fireEvent in overlay test instead of userEvent to trigger click.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Dec 4, 2024

🦋 Changeset detected

Latest commit: bed7c74

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the staff Author is a staff member label Dec 4, 2024
@francinelucca francinelucca added status: wip component: Tooltip Issues related to the Tooltip component enhancement New feature or request and removed staff Author is a staff member labels Dec 4, 2024
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Dec 4, 2024
Copy link
Contributor

github-actions bot commented Dec 4, 2024

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

github-actions bot commented Dec 4, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 103.5 KB (+0.15% 🔺)
packages/react/dist/browser.umd.js 103.81 KB (+0.07% 🔺)

…2-bug-tooltip-on-iconbutton-should-not-show-up-instantly
@@ -128,7 +128,7 @@ describe('Overlay', () => {
expect(container.getByText('Add to list')).toBeInTheDocument()

// open second menu
await user.click(container.getByText('Create list'))
fireEvent.click(container.getByText('Create list'))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried for minute to get this to work with user.click, I replicated this test manually in storybook and it works as expected. I noticed userEvent was triggering different events than manual testing did 🤷🏽‍♀️

Comment on lines +270 to +271
} else {
setIsPopoverOpen(false)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes bug where overlay would stay "stuck" and not able to close via keyboard due to popOver state being open but it not actually being in the DOM

@github-actions github-actions bot temporarily deployed to storybook-preview-5350 December 5, 2024 01:20 Inactive
@francinelucca francinelucca changed the title fix(TooltipV2): delay tooltip opening time by ms fix(TooltipV2): delay tooltip opening time by 50ms Dec 5, 2024
@github-actions github-actions bot temporarily deployed to storybook-preview-5350 December 5, 2024 01:25 Inactive
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Dec 5, 2024
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Dec 11, 2024
Copy link
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Dec 11, 2024
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/354745

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh labels Dec 12, 2024
@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Dec 12, 2024
@francinelucca francinelucca added this pull request to the merge queue Dec 13, 2024
Merged via the queue into main with commit 4bcf78b Dec 13, 2024
43 checks passed
@francinelucca francinelucca deleted the francinelucca/4432-bug-tooltip-on-iconbutton-should-not-show-up-instantly branch December 13, 2024 01:39
@primer primer bot mentioned this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Tooltip Issues related to the Tooltip component enhancement New feature or request integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants