fix(Tooltip): skip delay race condition with multiple tooltips#2002
fix(Tooltip): skip delay race condition with multiple tooltips#2002huntabyte merged 3 commits intohuntabyte:mainfrom
Conversation
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 detectedLatest commit: 0a66305 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
|
@AndersRobstad thanks a ton for this. Would you mind adding a test to the If you don't have the cycles to add the test I can add it once I have some time soon! |
|
Went ahead and added the tests as I had some time on my hand, thanks a ton! @AndersRobstad |
Ahhh thanks, great! Forgot to do that when I fixed it, looks great @huntabyte 💯 |
Summary
isOpenDelayedreset totrue, causing subsequent tooltip switches to require the fulldelayDurationagain instead of opening instantly#startTimer()inside the#openTooltip === tooltipguard so it only fires on genuine user-initiated closesCloses #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