-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
fix(overlays): ensure that only topmost overlay is announced by screen readers #28997
Conversation
@@ -62,7 +62,7 @@ | |||
</ion-toolbar> | |||
</ion-header> | |||
<ion-content class="ion-padding"> | |||
Modal Content | |||
Modal ${id} |
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.
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.
We might have a better fix for the spec test issue. Moving to draft for a sec. |
Okay, all good now 👍 |
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.
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?
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>
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-hidden
removed 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