Skip to content

Commit 4e3a13c

Browse files
authored
Revert "fix(toast): screen readers now announce toasts when presented (#24937)"
This reverts commit 8a97f6b.
1 parent 8a97f6b commit 4e3a13c

File tree

4 files changed

+0
-107
lines changed

4 files changed

+0
-107
lines changed

core/src/components/toast/readme.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,30 +59,6 @@ interface ToastOptions {
5959
interface ToastAttributes extends JSXBase.HTMLAttributes<HTMLElement> {}
6060
```
6161

62-
## Accessibility
63-
64-
### Focus Management
65-
66-
Toasts are intended to be subtle notifications and are not intended to interrupt the user. User interaction should not be required to dismiss the toast. As a result, focus is not automatically moved to a toast when one is presented.
67-
68-
### Screen Readers
69-
70-
`ion-toast` has `aria-live="polite"` and `aria-atomic="true"` set by default.
71-
72-
`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.
73-
74-
`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.
75-
76-
### Tips
77-
78-
While this is not a complete list, here are some guidelines to follow when using toasts.
79-
80-
* Do not require user interaction to dismiss toasts. For example, having a "Dismiss" button in the toast is fine, but the toast should also automatically dismiss on its own after a timeout period. If you need user interaction for a notification, consider using [ion-alert](./alert) instead.
81-
82-
* Avoid opening multiple toasts in quick succession. If `aria-live` is set to `'assertive'`, screen readers may interrupt the reading of the current task to announce the new toast, causing the context of the previous toast to be lost.
83-
84-
* For toasts with long messages, consider adjusting the `duration` property to allow users enough time to read the content of the toast.
85-
8662
<!-- Auto Generated Below -->
8763

8864

core/src/components/toast/test/a11y/index.html

Lines changed: 0 additions & 33 deletions
This file was deleted.

core/src/components/toast/test/a11y/toast.e2e.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

core/src/components/toast/toast.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ export class Toast implements ComponentInterface, OverlayInterface {
280280

281281
return (
282282
<Host
283-
aria-live="polite"
284-
aria-atomic="true"
285283
role={role}
286284
tabindex="-1"
287285
{...this.htmlAttributes as any}

0 commit comments

Comments
 (0)