Skip to content

fix(Tooltip): skip delay race condition with multiple tooltips#2002

Open
AndersRobstad wants to merge 1 commit intohuntabyte:mainfrom
AndersRobstad:fix/tooltip-skip-delay-race
Open

fix(Tooltip): skip delay race condition with multiple tooltips#2002
AndersRobstad wants to merge 1 commit intohuntabyte:mainfrom
AndersRobstad:fix/tooltip-skip-delay-race

Conversation

@AndersRobstad
Copy link
Copy Markdown

@AndersRobstad AndersRobstad commented Mar 27, 2026

Summary

  • Fixes a race condition where the skip-delay timer was unconditionally started when any tooltip closed, including force-closes triggered by another tooltip opening under the same provider
  • After the timer expired (~300ms), isOpenDelayed reset to true, causing subsequent tooltip switches to require the full delayDuration again instead of opening instantly
  • Moves #startTimer() inside the #openTooltip === tooltip guard so it only fires on genuine user-initiated closes

Closes #2001

With the new implementation:

Skjermopptak.2026-03-27.kl.12.39.40.mov

With the old one:

Skjermopptak.2026-03-27.kl.12.40.37.mov

When multiple tooltips share a provider, force-closing one tooltip to
open another would unconditionally start the skip-delay timer. After
the timer expired (default 300ms), `isOpenDelayed` reset to `true`,
causing subsequent tooltip switches to require the full delay again.

Move `#startTimer()` inside the `#openTooltip === tooltip` guard so
the skip-delay timer only starts on genuine closes — not when a
tooltip is force-closed because another one opened.

Closes huntabyte#2001

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

⚠️ No Changeset found

Latest commit: 65ac57f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
bits-ui ✅ Ready (View Log) Visit Preview 65ac57f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Tooltips don't always skip skipDelayDuration when inside same provider

1 participant