fix(ui-shell): improve header global action a11y #19509
Open
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.
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
Enter
andSpace
keys.focusout
anddocument.click
handlers to close the panel when focus is lost or the user clicks outside.Changed
@HostListener
forkeydown
to match the keyboard interaction.ownerDocument
instead ofdocument
to make sure the panel is found even inside Shadow DOM.Testing / Reviewing
Web Components Deploy Preview
>Header w/ Actions and Right Panel
.**Enter or Space**
on the**Notifications**
button:**Enter or Space**
again to close it.I used this as reference:
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
[N/A] Updated documentation and storybook examples[N/A] Wrote passing tests that cover this changeMore details can be found in the pull request guide