Skip to content

fix(ui-shell): improve header global action a11y #19509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

heloiselui
Copy link
Contributor

@heloiselui heloiselui commented May 28, 2025

Closes #19374

Continuation of #19289, that improves the behavior of header-global-action so the right panel now closes when focus is lost, and can also be toggled using Enter or Space. It also brings it in line with how the React version works.

Changelog

New

  • Added support for toggling the panel using Enter and Space keys.
  • Added focusout and document.click handlers to close the panel when focus is lost or the user clicks outside.

Changed

  • Used @HostListener for keydown to match the keyboard interaction.
  • Used ownerDocument instead of document to make sure the panel is found even inside Shadow DOM.

Testing / Reviewing

  • Go to Web Components Deploy Preview > Header w/ Actions and Right Panel.
  • Click or press **Enter or Space** on the **Notifications** button:
    • It should open the right panel.
    • Press **Enter or Space** again to close it.
  • Click or tab away from the button/panel:
    • The panel should close automatically.

I used this as reference:

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • [N/A] Updated documentation and storybook examples
  • [N/A] Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

Copy link

netlify bot commented May 28, 2025

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit a826eac
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/68384e0a26a5310009b3abc3
😎 Deploy Preview https://deploy-preview-19509--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented May 28, 2025

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit a826eac
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/68384e0ac421580008135563
😎 Deploy Preview https://deploy-preview-19509--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

codecov bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.48%. Comparing base (781e9d0) to head (a826eac).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19509      +/-   ##
==========================================
- Coverage   84.91%   84.48%   -0.44%     
==========================================
  Files         373      373              
  Lines       14504    14641     +137     
  Branches     4794     4837      +43     
==========================================
+ Hits        12316    12369      +53     
- Misses       2040     2125      +85     
+ Partials      148      147       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@heloiselui heloiselui marked this pull request as ready for review May 29, 2025 12:09
@heloiselui heloiselui requested review from a team as code owners May 29, 2025 12:09
@heloiselui heloiselui requested review from 2nikhiltom and kennylam May 29, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[a11y]: UI Shell right panel does not close on loss of focus
1 participant