Skip to content

fix(toast): screen readers now announce toasts when presented #24937

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

Merged
merged 4 commits into from
Mar 15, 2022
Merged

Conversation

liamdebeasi
Copy link
Contributor

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue URL: resolves #22333

What is the new behavior?

  • Screen readers now announce the toast content when it is presented
  • Screen readers now announce the toast as a single unit rather than announcing only the changed nodes.

Does this introduce a breaking change?

  • Yes
  • No

Other information

@liamdebeasi liamdebeasi requested a review from a team March 14, 2022 20:56
@github-actions github-actions bot added the package: core @ionic/core package label Mar 14, 2022
Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, love the write up and tips section on usage.

@liamdebeasi
Copy link
Contributor Author

liamdebeasi commented Aug 31, 2022

Update: This does not cause the toasts to be announced on present in all cases, just on update. See #25866.

I tested this on VoiceOver for macOS and that announces toasts when presented. VoiceOver for iOS, TalkBack, NVDA, and JAWS still do not announce toasts.

When testing locally VoiceOver for macOS, VoiceOver for iOS, and TalkBack announce an aria-live="assertive" toast when presented. JAWS and NVDA do not. I tested with VoiceOver and TalkBack which is why I thought this was working correctly originally.

@liamdebeasi
Copy link
Contributor Author

liamdebeasi commented Aug 31, 2022

Also, the docs are wrong: https://ionicframework.com/docs/api/toast#screen-readers

aria-live causes screen readers to announce the content of the toast when it is presented.

I had misunderstood the intent of aria-live because of the behavior in VoiceOver for macOS.

edit: Docs wording is fixed while I investigate how to better fix this: ionic-team/ionic-docs#2520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility issues with ion-toast component
3 participants