Skip to content

Commit 7c6cf92

Browse files
committed
fix(material/snack-bar): creates default assertive aria-live if not specified
Updates Angular Material Snack-Bar component snack-bar-container's aria-live value from AriaLivePoliteness value to default to assertive if there is no given value. This is to fix existing bugs where the snack-bar content is not read by the screenreader when the snack-bar appears. Fixes b/369493945
1 parent 30e09d7 commit 7c6cf92

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/material/snack-bar/snack-bar-container.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ export class MatSnackBarContainer extends BasePortalOutlet implements OnDestroy
9393
/** The state of the snack bar animations. */
9494
_animationState = 'void';
9595

96-
/** aria-live value for the live region. */
97-
_live: AriaLivePoliteness;
96+
/**
97+
* aria-live value for the live region. Set as 'assertive' by default if not specificed by
98+
* developer.
99+
*/
100+
_live?: AriaLivePoliteness | 'assertive';
98101

99102
/**
100103
* Element that will have the `mdc-snackbar__label` class applied if the attached component

0 commit comments

Comments
 (0)