fix(overlays): ensure that only topmost overlay is announced by screen readers - #28997
Merged
Conversation
added 14 commits
February 7, 2024 13:21
averyrousseau
commented
Feb 8, 2024
| </ion-header> | ||
| <ion-content class="ion-padding"> | ||
| Modal Content | ||
| Modal ${id} |
Contributor
Author
There was a problem hiding this comment.
This isn't necessary for the fix, but I found it very useful while debugging since the page lets you create as many modals as you want, and this makes it easier to tell which one you're looking at. I can revert if we'd rather keep things slim.
averyrousseau
marked this pull request as ready for review
February 8, 2024 16:55
averyrousseau
requested review from
brandyscarney
and removed request for
a team
February 8, 2024 16:55
Contributor
Author
|
We might have a better fix for the spec test issue. Moving to draft for a sec. |
averyrousseau
marked this pull request as draft
February 8, 2024 18:10
averyrousseau
marked this pull request as ready for review
February 8, 2024 19:23
Contributor
Author
|
Okay, all good now 👍 |
sean-perkins
approved these changes
Feb 9, 2024
sean-perkins
left a comment
Contributor
There was a problem hiding this comment.
Tested the changes locally with voice over, works great!
Can we update the PR description to describe the new behavior impact? For example:
Screen readers will announce only the top-most visible overlay.
Suggestion for the PR title, can we use "announced" language vs. visible?
2 tasks
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Mar 12, 2024
Issue number: resolves #29139 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> When implementing #28997 we did not consider the case where a Toast could be presented. When presenting a Toast after presenting a Modal the linked change causes the Modal to be hidden from screen readers. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - If the top-most overlay is a Toast then the closest non-Toast overlay is also not hidden from screen readers. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev build: `7.7.5-dev.11710260658.1fc29a6c` --------- Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
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 #23472
What is the current behavior?
If multiple overlays are presented at the same time, none of them receive
aria-hidden="true". This means that screen readers can read contents from overlays behind the current one, which can be confusing for users.The original issue also reports router outlets getting
aria-hiddenremoved when any overlay is dismissed, not just the last one, but we've since fixed that:ionic-framework/core/src/utils/overlays.ts
Lines 573 to 576 in 35ab6b4
What is the new behavior?
All overlays besides the topmost one now receive
aria-hidden="true". This means that screen readers will only announce the topmost overlay.Does this introduce a breaking change?
Other information