Skip to content

Commit

Permalink
docs(toast): fix aria-live usage (#2520)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamdebeasi authored Aug 31, 2022
1 parent 5fd7ce4 commit 0506f01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api/toast.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Toasts are intended to be subtle notifications and are not intended to interrupt

`ion-toast` has `aria-live="polite"` and `aria-atomic="true"` set by default.

`aria-live` causes screen readers to announce the content of the toast when it is presented. However, since the attribute is set to `'polite'`, screen readers generally do not interrupt the current task. Developers can customize this behavior by using the `htmlAttributes` property to set `aria-live` to `'assertive'`. This will cause screen readers to immediately notify the user when a toast is presented, potentially interrupting any previous updates.
`aria-live` causes screen readers to announce the content of the toast when it is updated. However, since the attribute is set to `'polite'`, screen readers generally do not interrupt the current task. Developers can customize this behavior by using the `htmlAttributes` property to set `aria-live` to `'assertive'`. This will cause screen readers to immediately notify the user when a toast is updated, potentially interrupting any previous updates.

`aria-atomic="true"` is set to ensure that the entire toast is announced as a single unit. This is useful when dynamically updating the content of the toast as it prevents screen readers from announcing only the content that has changed.

Expand Down Expand Up @@ -497,4 +497,4 @@ export default defineComponent({
<CustomProps />

## Slots
<Slots />
<Slots />

1 comment on commit 0506f01

@vercel
Copy link

@vercel vercel bot commented on 0506f01 Aug 31, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

ionic-docs – ./

ionic-docs-git-main-ionic1.vercel.app
ionic-docs-ionic1.vercel.app
ionic-docs-gqykycf8t.vercel.app

Please sign in to comment.