-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Modal: Accessibly hide/show outer modal when nested
#54743
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
Conversation
|
Flaky tests detected in a9ae3fe. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6340981048
|
ciampo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Let's add a CHANGELOG entry (I guess under enhancements?) and then merge!
| if ( openModalCount === 0 ) { | ||
| document.body.classList.remove( bodyOpenClassName ); | ||
| ariaHelper.showApp(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the separation of concerns here between modalizing/unmodalizing and adding/removing the body classname
chad1008
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and tests well for me!
204fbb8 to
a9ae3fe
Compare
|
Thanks for reviews and testing! |
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