mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs(form-field): improve a11y of password visibility toggle (#15129)
Fixes #15023
This commit is contained in:
committed by
Jeremy Elbourn
parent
484a96cb4c
commit
2a086ce475
+3
-1
@@ -1,7 +1,9 @@
|
||||
<div class="example-container">
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Enter your password" [type]="hide ? 'password' : 'text'">
|
||||
<mat-icon matSuffix (click)="hide = !hide">{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
|
||||
<button mat-icon-button matSuffix (click)="hide = !hide" [attr.aria-label]="'Hide password'" [attr.aria-pressed]="hide">
|
||||
<mat-icon>{{hide ? 'visibility_off' : 'visibility'}}</mat-icon>
|
||||
</button>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
|
||||
Reference in New Issue
Block a user