Modal: Accessibly hide/show outer modal when nested - #54743
Merged
Conversation
|
Flaky tests detected in a9ae3fe. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6340981048
|
ciampo
approved these changes
Sep 28, 2023
ciampo
left a comment
Contributor
There was a problem hiding this comment.
LGTM 🚀
Let's add a CHANGELOG entry (I guess under enhancements?) and then merge!
| if ( openModalCount === 0 ) { | ||
| document.body.classList.remove( bodyOpenClassName ); | ||
| ariaHelper.showApp(); | ||
| } |
Contributor
There was a problem hiding this comment.
I appreciate the separation of concerns here between modalizing/unmodalizing and adding/removing the body classname
chad1008
approved these changes
Sep 28, 2023
chad1008
left a comment
Contributor
There was a problem hiding this comment.
Looks good and tests well for me!
stokesman
force-pushed
the
update/modal-nested-aria
branch
from
September 28, 2023 15:24
204fbb8 to
a9ae3fe
Compare
Contributor
Author
|
Thanks for reviews and testing! |
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.
What?
Updates the existing logic for accessibly isolating the
Modalcomponent so that it works for nested modals. More specifically, when the nested modal is opened the "opener" modal has itsaria-hiddenattribute set to"true".Why?
It seems like how it’s supposed to work and we added a test for it in #54569.
How?
Modalmounts/unmounts instead of only for the first/final modal.Testing Instructions
Testing Instructions for Keyboard
I tried to make the instructions above applicable for keyboard use.
Screenshots or screencast
modal-nested-aria.mp4