Skip to content

Commit 8b03374

Browse files
authored
fix(material/snack-bar): change politeness level (#30851)
* fix(material/snack-bar): change politeness level change politeness level of snack bar to polite to match docs fixes b/364250804 * fix(material/snack-bar): update unit tests update unit tests fixes b/364250804
1 parent f699d2e commit 8b03374

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type MatSnackBarVerticalPosition = 'top' | 'bottom';
2424
*/
2525
export class MatSnackBarConfig<D = any> {
2626
/** The politeness level for the MatAriaLiveAnnouncer announcement. */
27-
politeness?: AriaLivePoliteness = 'assertive';
27+
politeness?: AriaLivePoliteness = 'polite';
2828

2929
/**
3030
* Message to be announced by the LiveAnnouncer. When opening a snackbar without a custom

src/material/snack-bar/testing/snack-bar-harness.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ describe('MatSnackBarHarness', () => {
7676
it('should be able to get aria-live of snack-bar', async () => {
7777
fixture.componentInstance.openCustom();
7878
let snackBar = await loader.getHarness(MatSnackBarHarness);
79-
expect(await snackBar.getAriaLive()).toBe('assertive');
79+
expect(await snackBar.getAriaLive()).toBe('polite');
8080

81-
fixture.componentInstance.openCustom({politeness: 'polite'});
81+
fixture.componentInstance.openCustom({politeness: 'assertive'});
8282
snackBar = await loader.getHarness(MatSnackBarHarness);
83-
expect(await snackBar.getAriaLive()).toBe('polite');
83+
expect(await snackBar.getAriaLive()).toBe('assertive');
8484

8585
fixture.componentInstance.openCustom({politeness: 'off'});
8686
snackBar = await loader.getHarness(MatSnackBarHarness);

0 commit comments

Comments
 (0)