Skip to content

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

Merged
francinelucca merged 11 commits into
mainfrom
francinelucca/4432-bug-tooltip-on-iconbutton-should-not-show-up-instantly
Dec 13, 2024
Merged

fix(TooltipV2): delay tooltip opening time by 50ms#5350
francinelucca merged 11 commits into
mainfrom
francinelucca/4432-bug-tooltip-on-iconbutton-should-not-show-up-instantly

Conversation

@francinelucca

@francineluccafrancinelucca commented Dec 4, 2024

Copy link
Copy Markdown
Member

Closeshttps://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

@changeset-bot

changeset-botBot commented Dec 4, 2024

Copy link
Copy Markdown

🦋 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
NameType
@primer/reactPatch

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-actionsgithub-actionsBot added the staff Author is a staff member label Dec 4, 2024
@francineluccafrancinelucca 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-actionsgithub-actionsBot 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
@github-actions

Copy link
Copy Markdown
Contributor

👋 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!

@github-actions

github-actionsBot commented Dec 4, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js103.5 KB (+0.15% 🔺)
packages/react/dist/browser.umd.js103.81 KB (+0.07% 🔺)

…2-bug-tooltip-on-iconbutton-should-not-show-up-instantly

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

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

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-actionsBottemporarily deployed to storybook-preview-5350 December 5, 2024 01:20 Inactive
@francineluccafrancinelucca changed the title fix(TooltipV2): delay tooltip opening time by msfix(TooltipV2): delay tooltip opening time by 50msDec 5, 2024
@github-actions
github-actionsBottemporarily deployed to storybook-preview-5350 December 5, 2024 01:25 Inactive
@github-actionsgithub-actionsBot 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
@github-actions

Copy link
Copy Markdown
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-actionsgithub-actionsBot 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
@github-actions

Copy link
Copy Markdown
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-actionsBottemporarily deployed to storybook-preview-5350 December 11, 2024 22:01 Inactive
@github-actionsgithub-actionsBot 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
Copy Markdown

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

@github-actionsgithub-actionsBot 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
Copy Markdown

🟢 golden-jobs completed with status success.

@github-actionsgithub-actionsBot 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 queueDec 13, 2024
Merged via the queue into main with commit 4bcf78bDec 13, 2024
@francinelucca
francinelucca deleted the francinelucca/4432-bug-tooltip-on-iconbutton-should-not-show-up-instantly branch December 13, 2024 01:39
@primerprimerBot mentioned this pull request Dec 13, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: TooltipIssues related to the Tooltip componentenhancementNew feature or requestintegration-tests: passingChanges 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

@francinelucca@joshblack