-
Notifications
You must be signed in to change notification settings - Fork 6.8k
mat-select placeholder not working. #19514
Copy link
Copy link
Closed
livepoll/live-poll
#189Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/select
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:
<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
Anything else relevant?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/select