Repository navigation
fix(modal): name the dialog from aria-labelledby - #31689
Open
akasakariko wants to merge 1 commit into
Open
akasakariko wants to merge 1 commit into
akasakariko wants to merge 1 commit into
Conversation
aria-labelledby set on ion-modal stayed on the host, so the dialog in the shadow root had no accessible name. An ID reference only resolves against the tree of the element that carries it, so the attribute cannot name the dialog with content authored in the light DOM The referenced elements are now applied to the dialog through element reflection, which is not scoped to a tree. This names the dialog with an ion-title in the modal content, as documented fixes ionic-team#31622
|
@akasakariko is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
Issue number: resolves #31622
What is the current behavior?
aria-labelledbyset onion-modalstays on the host, so the[role="dialog"]element in the shadow root has no accessible name. An ID reference only resolves against the tree of the element that carries it, so copying the attribute onto the wrapper does not name the dialog eitherWhat is the new behavior?
ion-modalresolves the elements referenced byaria-labelledbyand applies them to the dialog through element reflection (ariaLabelledByElements), which is not scoped to a treeion-titlein its content now names the dialogaria-labelon the modal still names the dialog whenaria-labelledbydoes notDoes this introduce a breaking change?
Other information
Element reflection is Baseline 2025, so in older browsers the dialog is unnamed as it was before this change
Verification:
aria-dialog-nameviolation and passes after itnpx playwright test src/components/modal/test/a11ypasses on Mobile Chrome, Mobile Firefox and Mobile Safarinpx stencil test --specpasses (93 suites, 830 tests)npx eslintandnpx prettier --checkpass on the changed filesrole=dialogwith the nameMy modal titlefor a modal labelled witharia-labelledby