Description
🐞 bug report
Affected Package
Angular Material 9
Is this a regression?
Not sure.
Description
Using placeholder
attribute has no effect in mat-select, if mat-label
is provided also.
🔬 Minimal Reproduction
Forked from the mat-select example in the documentation:
https://stackblitz.com/edit/angular-qlpnim-vyfruq?file=src/app/select-overview-example.html
<h4>Basic mat-select</h4>
<mat-form-field>
<mat-label>Favorite food</mat-label>
<mat-select placeholder="No value selected"> <!-- this is not showing-->
<mat-option *ngFor="let food of foods" [value]="food.value">
{{food.viewValue}}
</mat-option>
</mat-select>
</mat-form-field>
Expected and Actual behavior.
Expected: If provided, the label floats to the top of the field, and the placeholder text can be seen if no value is selected.
Actual: the label acts as a placeholder.
🔥 Exception or Error
--
🌍 Your Environment
Angular Version:
@angular/material 9.0.1