I have a mat-form-field with a text input control. I have a mat-label and I also put an aria-label attribute attr.aria-label
on the input element directly.
Is the mat-label
sufficient for screen readers by itself? Is the attr.aria-label
necessary or redundant?
<mat-form-field appearance="outline" floatLabel="always">
<mat-label>Username</mat-label>
<input attr.aria-label="Username" formControlName="Username" matInput>
</mat-form-field>
The same question goes for the mat-select control.
<mat-form-field appearance="outline" floatLabel="always">
<mat-label>Cars</mat-label>
<mat-select formControlName="Car">
<mat-option *ngFor="let car of cars" [value]="car.name">
{{car.name}}
</mat-option>
</mat-select>
</mat-form-field>