Skip to content

fix(overlay): additional content not dismissible#5893

Merged
caseyisonit merged 5 commits intomainfrom
mijordan/SWC-1047
Nov 17, 2025
Merged

fix(overlay): additional content not dismissible#5893
caseyisonit merged 5 commits intomainfrom
mijordan/SWC-1047

Conversation

@majornista
Copy link
Contributor

@majornista majornista commented Nov 14, 2025

Description

Fix for SWC-1047: hover overlays should close with the Esc key when trigger is not focus.

Motivation and context

Fixes accessibility compliance failure of Success Criterion 1.4.13 Content on Hover or Focus (Level AA), because tooltips that display on hover cannot be dismissed using the Escape key.

Related issue(s)

  • fixes SWC-1047

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • _Overlay: Deep Child Tooltip _

    1. Go to the Overlay: Deep Child Tooltip Storybook example.
    2. In the Storybook canvas frame, Click the button that reads "Open popover."
    3. In popover overlay that opens, click the button that reads "Open sub popover."
    4. In the popover overlay that opens, press the Tab key so that keyboard focus moves to the button labelled "Just a button."
    5. Now hover the button that reads "Button with self-managed tooltip," which should open a tooltip that reads "Deep Child ToolTip."
    6. With the button hovered but not focused and displaying the tooltip, press the Escape key.
    7. This should close the tooltip, without shifting focus to the tooltip trigger and without closing the popover.
    8. Press Escape key again to close the popover, restoring focus to the "Open sub popover" in the overlay below.
    9. Press Escape key again to close the popover, restoring focus to the "Open popover" in the page below.
  • Overlay: Hover With Interactive Content

    1. Go to the Overlay: Hover With Interactive Content Storybook example.
    2. In the Storybook canvas frame, set focus to the first button that reads "Hover for interactive buttons."
    3. A popover containing three buttons will appear, but rather than interact with the buttons in the popover,
    4. Hover the next button in the underlying page, "Hover for interactive links."
    5. The first popover containing the buttons with hide, and a popover containing a list of links will appear.
    6. Note that the keyboard focus is still on the button labelled "Hover for interactive buttons."
    7. Press Escape key to close the popover containing the list of links.
    8. Focus will remain on the on the button labelled "Hover for interactive buttons."

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

@majornista majornista requested a review from a team as a code owner November 14, 2025 19:34
@changeset-bot
Copy link

changeset-bot bot commented Nov 14, 2025

🦋 Changeset detected

Latest commit: 4969dce

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

This PR includes changesets to release 80 packages
Name Type
@spectrum-web-components/overlay Patch
@spectrum-web-components/core Patch
@spectrum-web-components/combobox Patch
@spectrum-web-components/contextual-help Patch
@spectrum-web-components/menu Patch
@spectrum-web-components/picker Patch
@spectrum-web-components/popover Patch
@spectrum-web-components/tooltip Patch
@spectrum-web-components/bundle Patch
@spectrum-web-components/truncated Patch
@spectrum-web-components/alert-banner Patch
@spectrum-web-components/asset Patch
@spectrum-web-components/badge Patch
@spectrum-web-components/divider Patch
@spectrum-web-components/progress-circle Patch
@spectrum-web-components/status-light Patch
@spectrum-web-components/base Patch
@spectrum-web-components/theme Patch
@adobe/swc Patch
@spectrum-web-components/breadcrumbs Patch
@spectrum-web-components/action-menu Patch
@spectrum-web-components/action-bar Patch
@spectrum-web-components/card Patch
@spectrum-web-components/coachmark Patch
@spectrum-web-components/alert-dialog Patch
@spectrum-web-components/dialog Patch
@spectrum-web-components/button Patch
@spectrum-web-components/reactive-controllers Patch
@spectrum-web-components/accordion Patch
@spectrum-web-components/action-button Patch
@spectrum-web-components/action-group Patch
@spectrum-web-components/avatar Patch
@spectrum-web-components/button-group Patch
@spectrum-web-components/checkbox Patch
@spectrum-web-components/clear-button Patch
@spectrum-web-components/close-button Patch
@spectrum-web-components/color-area Patch
@spectrum-web-components/color-field Patch
@spectrum-web-components/color-handle Patch
@spectrum-web-components/color-loupe Patch
@spectrum-web-components/color-slider Patch
@spectrum-web-components/color-wheel Patch
@spectrum-web-components/dropzone Patch
@spectrum-web-components/field-group Patch
@spectrum-web-components/field-label Patch
@spectrum-web-components/help-text Patch
@spectrum-web-components/icon Patch
@spectrum-web-components/icons-ui Patch
@spectrum-web-components/icons-workflow Patch
@spectrum-web-components/icons Patch
@spectrum-web-components/iconset Patch
@spectrum-web-components/illustrated-message Patch
@spectrum-web-components/infield-button Patch
@spectrum-web-components/link Patch
@spectrum-web-components/meter Patch
@spectrum-web-components/modal Patch
@spectrum-web-components/number-field Patch
@spectrum-web-components/picker-button Patch
@spectrum-web-components/progress-bar Patch
@spectrum-web-components/radio Patch
@spectrum-web-components/search Patch
@spectrum-web-components/sidenav Patch
@spectrum-web-components/slider Patch
@spectrum-web-components/split-view Patch
@spectrum-web-components/swatch Patch
@spectrum-web-components/switch Patch
@spectrum-web-components/table Patch
@spectrum-web-components/tabs Patch
@spectrum-web-components/tags Patch
@spectrum-web-components/textfield Patch
@spectrum-web-components/thumbnail Patch
@spectrum-web-components/toast Patch
@spectrum-web-components/top-nav Patch
@spectrum-web-components/tray Patch
@spectrum-web-components/underlay Patch
@spectrum-web-components/grid Patch
@spectrum-web-components/opacity-checkerboard Patch
@spectrum-web-components/shared Patch
@spectrum-web-components/styles Patch
@spectrum-web-components/eslint-plugin 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
Copy link
Contributor

github-actions bot commented Nov 14, 2025

📚 Branch Preview

🔍 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-5893

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an accessibility compliance issue (WCAG 2.2 Success Criterion 1.4.13) by enabling hover-triggered overlays (tooltips/hints) to be dismissed with the Escape key, even when the trigger element doesn't have focus.

  • Added escape key handling for 'hint' type overlays in OverlayStack
  • Includes comprehensive test coverage for the new functionality
  • Properly prevents event propagation to avoid unintended side effects

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
1st-gen/packages/overlay/src/OverlayStack.ts Adds escape key handling for 'hint' type overlays with proper event prevention
1st-gen/packages/overlay/test/overlay-trigger-hover.test.ts Adds test for escape key dismissal and fixes existing test to dispatch event on tooltip
1st-gen/packages/overlay/test/index.ts Adds integration test for escape key closing hover popovers
2nd-gen/packages/core/shared/base/version.ts Adds Apache License copyright header to generated file
.changeset/funny-eggs-sell.md Documents the patch-level changes for overlay and core packages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

majornista and others added 5 commits November 17, 2025 12:02
Fix SWC-1047: hover overlays should close with the Esc key when trigger is not focus.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor

📚 Branch Preview Links

🔍 First Generation 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-5893

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.

@@ -0,0 +1,6 @@
---
'@spectrum-web-components/overlay': patch
'@spectrum-web-components/core': patch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core doesnt need to be included in this changeset since the only thing added was a copyright

Copy link
Contributor

@caseyisonit caseyisonit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one minor nit but otherwise good work

@caseyisonit caseyisonit added Contribution PRs from contributors Status:Ready for review PR ready for review or re-review. labels Nov 17, 2025
@caseyisonit caseyisonit self-assigned this Nov 17, 2025
Copy link
Member

@cdransf cdransf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you! ✨

@caseyisonit caseyisonit merged commit 1d76b70 into main Nov 17, 2025
21 checks passed
@caseyisonit caseyisonit deleted the mijordan/SWC-1047 branch November 17, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Contribution PRs from contributors Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants