[modal] Fix aria-hidden should not apply on non-portal modals - #49026
Open
ZeeshanTamboli wants to merge 12 commits into
Open
[modal] Fix aria-hidden should not apply on non-portal modals#49026ZeeshanTamboli wants to merge 12 commits into
ZeeshanTamboli wants to merge 12 commits into
Conversation
Deploy previewBundle size
Check out the code infra dashboard for more information about this PR. |
ZeeshanTamboli
marked this pull request as ready for review
August 25, 2026 08:54
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.
Fixes #19450
Closes #43318 (Old PR)
Closes #48889 (Another PR attempt but does not handle this case)
Do not apply
aria-hiddenon non-portal modals (i.e whendisablePortal) ancestor. This hides the modals from the accessibility tree. Also, mark the siblings of modal asaria-hiddenso that they are inaccessible when the modal is opened. Handles cases with nested modals as well.Test the reproductions on Mozilla Firefox because Blink (rendering engine used by Google Chrome etc) blocks the aria-hidden on elements whose descendents have focus by default. So, it's reproducible in Firefox but a general issue on all browsers. Use a screen-reader and test it out:
Before: https://stackblitz.com/edit/github-fennfewl?file=src%2FApp.tsx
After fix: https://stackblitz.com/edit/github-fennfewl-krrbcqn3