Skip to content

Commit 31df21c

Browse files
jelbournandrewseguin
authored andcommitted
docs(snack-bar): expand a11y guidance (#11012)
1 parent fd44381 commit 31df21c

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/lib/snack-bar/snack-bar.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,20 @@ If you want to override the default snack bar options, you can do so using the
8686
```
8787

8888
### Accessibility
89-
Snack-bar messages are announced via an `aria-live` region. Focus is not moved to
90-
the snack-bar element, as this would be disruptive to a user in the middle of a
91-
workflow. For any action offered in the snack-bar, the application should offer the
92-
user an alternative way to perform the action (typically via keyboard shortcut).
89+
Snack-bar messages are announced via an `aria-live` region. By default, the `polite` setting is
90+
used. While `polite` is recommended, this can be customized by setting the `politeness` property of
91+
the `MatSnackBarConfig`.
92+
93+
Focus is not, and should not be, moved to the snack-bar element. Moving the focus would be
94+
disruptive to a user in the middle of a workflow. It is recommended that, for any action offered
95+
in the snack-bar, the application offer the user an alternative way to perform the action.
96+
Alternative interactions are typically keyboard shortcuts or menu options. When the action is
97+
performed in this way, the snack-bar should be dismissed.
98+
99+
Snack-bars that have an action available should not be given a `duration`, as to accomodate
100+
screen-reader users that want to navigate to the snack-bar element to activate the action. If the
101+
user has manually moved their focus within the snackbar, focus should be placed somewhere sensible
102+
based on the application context when the snack-bar is dismissed.
103+
104+
Don't use "Dismiss" as a snack-bar-action, instead preferring to use a `duration` when there is
105+
no additional action associated with the notification.

0 commit comments

Comments
 (0)