-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(cdk/a11y): add example of LiveAnnouncer inside dialog (#27944)
Update the live-announcer demo in the dev-app. Add an example of calling LiveAnnouncer inside of a Dialog. Create another way to reproduce issues with using live regions inside an aria-modal (#22733). (cherry picked from commit 504ff7f)
- Loading branch information
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ ng_module( | |
deps = [ | ||
"//src/cdk/a11y", | ||
"//src/material/button", | ||
"//src/material/dialog", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
<div> | ||
<p> | ||
<button | ||
mat-raised-button | ||
color="primary" | ||
(click)="announceText('Hey Google')">Announce Text</button> | ||
</div> | ||
</p> | ||
<p> | ||
<button | ||
mat-raised-button | ||
color="primary" | ||
(click)="openDialog()">Open Dialog</button> | ||
</p> | ||
|
||
<ng-template let-data let-dialogRef="dialogRef"> | ||
<h2>Live Announcer Test Dialog</h2> | ||
<p>Test LiveAnnouncer inside an aria modal.</p> | ||
<p> | ||
<button | ||
mat-raised-button | ||
color="primary" | ||
(click)="announceText('Hey Google')">Announce Text</button> | ||
</p> | ||
<button type="button" cdkFocusInitial | ||
mat-button | ||
(click)="dialogRef.close()"> | ||
Close | ||
</button> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters