Skip to content

fix(tooltip): use popover="manual" so tooltips coexist with open popovers - #6595

Draft
rubencarvalho wants to merge 11 commits into
mainfrom
rcarvalho/fix-tooltip-popover-coexistence
Draft

fix(tooltip): use popover="manual" so tooltips coexist with open popovers#6595
rubencarvalho wants to merge 11 commits into
mainfrom
rcarvalho/fix-tooltip-popover-coexistence

Conversation

@rubencarvalho

@rubencarvalho rubencarvalho commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Tooltip used popover="auto", so opening a tooltip on hover light-dismissed any other open auto popover — including an <swc-popover> the user was still working in. Switching to popover="manual" takes the tooltip out of the native auto light-dismiss group, so a hover tooltip and an open popover now coexist in both directions.

Escape and close-on-leave are already handled internally by the component, so nothing is lost by dropping native light-dismiss. This also restores the Spectrum 1 type="hint" isolation behavior.

Tests

  • Added three coexistence tests: opening a tooltip over an open popover, opening a popover over a visible tooltip, and a tooltip on a control nested inside an open popover.
  • Updated stale assertions/comments that assumed popover="auto".
  • Tooltip suite 33/33 (Vitest); a11y 18/18 across Chromium/Firefox/WebKit — including trusted-Escape close under manual.

Accessibility testing checklist

  • Keyboard
    1. Open components-tooltip--overview; focus the trigger with Tab.
    2. Confirm the tooltip appears on focus and Escape closes it; focus stays on the trigger.
  • Screen reader
    1. Focus the trigger; confirm the tooltip text is announced as its description (role="tooltip" wired via aria-describedby).
    2. Open an <swc-popover>, then hover a tooltipped control; confirm the popover is not dismissed and both remain available.

…vers

Tooltip used popover="auto", so opening a tooltip on hover light-dismissed
any other open auto popover — including an <swc-popover> the user was still
working in. Switch to popover="manual" so the tooltip is not part of the
auto light-dismiss group; it coexists with an open popover in both
directions. Escape and close-on-leave are already handled internally, so
nothing is lost by dropping native light-dismiss.
@rubencarvalho
rubencarvalho requested a review from a team as a code owner August 7, 2026 14:11
@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1e5c1b

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

This PR includes changesets to release 2 packages
Name Type
@adobe/spectrum-wc Patch
@adobe/spectrum-wc-core 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 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6595

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@coveralls

coveralls commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 31215116937

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage remained the same at 96.239%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 39268
Covered Lines: 37993
Line Coverage: 96.75%
Relevant Branches: 6465
Covered Branches: 6020
Branch Coverage: 93.12%
Branches in Coverage %: Yes
Coverage Strength: 460.21 hits per line

💛 - Coveralls

@rubencarvalho rubencarvalho added the Status:WIP PR is a work in progress or draft label Aug 7, 2026
rubencarvalho and others added 4 commits August 7, 2026 17:21
… surface first

With popover="manual", a tooltip open on top of an <swc-popover> was not part of
any Escape-ordering coordination: one Escape triggered both the tooltip's own
handler and the browser's native auto-popover light-dismiss, closing both surfaces
at once.

Register the tooltip in the shared dismissible stack while open, and move its
Escape handler to the capture phase gated on isTopDismissible(). When the tooltip
is topmost it now preventDefault()s the native popover dismiss and stopPropagation,
so the first Escape closes only the tooltip and leaves the popover the user is
working in open; a second Escape closes the popover. This matches the pattern
Popover already uses.

- add register/unregister + capture-phase gated handleKeyDown
- synthetic guard EscapeClosesTopmostTooltipTest (vitest)
- trusted-input ordering test in tooltip.a11y.spec.ts
- update changeset, tooltip.mdx, migration-guide.mdx
… orders

Replace the single trusted-input Escape test with a data-driven pair covering
both open orders (popover-then-tooltip and tooltip-then-popover). Each opens the
two surfaces in a fixed order and asserts Escape dismisses them in reverse (LIFO):
the topmost closes first and every surface below it stays open, then the next
Escape closes the following one. Also drop em dashes from the touched comments per
the style guide.
@rubencarvalho
rubencarvalho marked this pull request as draft August 7, 2026 15:49
rubencarvalho and others added 4 commits August 7, 2026 21:11
The ci-a11y Storybook builds `*.stories.ts` but not the `.test.ts` fixtures, so
the a11y spec's `tooltip-tests--coexists-*` story ids never existed there and
gotoStory timed out waiting for the custom element. Add a hidden
CoexistenceWithPopover fixture (popover + tooltip in one iframe, `!test` so the
automatic axe run skips it) to tooltip.stories.ts and point both ordering tests
at it; they differ only in which surface opens last.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status:WIP PR is a work in progress or draft

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants