Skip to content

Commit

Permalink
fix(material/snack-bar): creates default assertive aria-live if not s…
Browse files Browse the repository at this point in the history
…pecified

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
  • Loading branch information
essjay05 committed Oct 2, 2024
1 parent 30e09d7 commit 7c6cf92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/material/snack-bar/snack-bar-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ export class MatSnackBarContainer extends BasePortalOutlet implements OnDestroy
/** The state of the snack bar animations. */
_animationState = 'void';

/** aria-live value for the live region. */
_live: AriaLivePoliteness;
/**
* aria-live value for the live region. Set as 'assertive' by default if not specificed by
* developer.
*/
_live?: AriaLivePoliteness | 'assertive';

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

0 comments on commit 7c6cf92

Please sign in to comment.