Skip to content

Commit 2a086ce

Browse files
Suresh918jelbourn
authored andcommitted
docs(form-field): improve a11y of password visibility toggle (#15129)
Fixes #15023
1 parent 484a96c commit 2a086ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/material-examples/form-field-prefix-suffix/form-field-prefix-suffix-example.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<div class="example-container">
22
<mat-form-field>
33
<input matInput placeholder="Enter your password" [type]="hide ? 'password' : 'text'">
4-
<mat-icon matSuffix (click)="hide = !hide">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
4+
<button mat-icon-button matSuffix (click)="hide = !hide" [attr.aria-label]="'Hide password'" [attr.aria-pressed]="hide">
5+
<mat-icon>{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
6+
</button>
57
</mat-form-field>
68

79
<mat-form-field>

0 commit comments

Comments
 (0)