docs(form-field): improve a11y of password visibility toggle (#15129)

Fixes #15023
This commit is contained in:
Suresh918
2019-02-23 02:34:29 +08:00
committed by Jeremy Elbourn
parent 484a96cb4c
commit 2a086ce475
@@ -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>