Repository navigation
fix: close tooltips when their anchors become inert - #299
Merged
Merged
Conversation
Contributor
Author
|
Updated in
There is no runtime change. |
Owner
|
thanks! #303 just merged and this now conflicts in lib/component-about.ts (tooltip accessibility paragraph) and lib/component-dates.ts. can you rebase on main? keep both changes in the tooltip paragraph. |
l4u532
force-pushed
the
fix/tooltip-inert-trigger
branch
from
November 30, 2026 09:10
a806814 to
fe8f560
Compare
Contributor
Author
|
Updated: rebased on
Verification on 2026-11-30:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tl;dr
Reproduction and cause
Hover a toolbar button, then open Morphing Lightbox by timer or keyboard shortcut. Keep the pointer still. The viewer marks the toolbar's ancestor inert. Chrome sent a
pointerleave, and Tooltip's pointer corridor kept the label open while it waited for another pointer move. A delayed hover could also open after the ancestor became inert.Tooltip now checks for
[inert]at the hover request and again when the label would open. While open is requested, it watches the anchor and its ancestors. A delayed hover rechecks the anchor when its timer fires. For an open tooltip, an inert anchor cancels close and pointer-corridor work and requests a close through the existing tooltip lifecycle. On a trigger that Tooltip manages, it also removes the description link.Scope and contract
The check covers TooltipTrigger, shorthand triggers, and external HTML or SVG anchors. Controlled
open={true}stays visually suppressed while inert. A caller that keepsopen={true}can show the label again when the anchor becomes active.Morphing Lightbox sets an explicit
inertattribute. Drawer, Bottom Sheet, Morphing Modal, and Center Morph Modal use focus traps and leave the background trigger outside the attribute's scope. NativeshowModal()uses browser-managed inertness and is outside this change. Chrome hit-tested the native dialog above the tooltip, which stayed in the document.Browser verification
Captured on 2026-11-29 against
c0944430andd58d8935. The Chrome GIF and frame sheet show the label disappearing when the toolbar becomes inert. The Lightbox pairs show where the baseline label lingered.Chrome toolbar
Chrome Lightbox
iPad Safari Lightbox
[inert]in both revisions.[inert].showModal()The browser checks ran after the dev route mounted interactively. Its site chrome logged a hydration mismatch, so first paint is unverified.
Test plan
inertto its containing toolbar while the pointer stays still. The label closes andaria-describedbyclears.valueandonValueChange). Give a separate button a click handler that opens the first image after one second. Press it, then hover the Tooltip button and hold still. The label disappears when the viewer opens.bun run checkandbun test. Both commands passed, including 196 registry components and 240 accessibility tests. The new test checks tooltip exposure and its description link after the trigger becomes inert.