You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
If a form control is set with a null value, mat-select cannot reflect that by displaying the correct mat-option with value set to null, but it works with a native select.
This behavior is important, because for example if you are building form controls for filtering some data displayed in a UI, you must be able to have a state where all controls are empty, and thus nothing is filtered. The null option can display "All" or something similar - indicating to the user that nothing is filtered. e.g.:
<mat-option[value]="null">All</mat-option>
This issue has existed at least as far back as v 14.
Is this a regression?
The previous version in which this bug was not present was
No response
Description
If a form control is set with a null value, mat-select cannot reflect that by displaying the correct mat-option with value set to null, but it works with a native select.
This behavior is important, because for example if you are building form controls for filtering some data displayed in a UI, you must be able to have a state where all controls are empty, and thus nothing is filtered. The null option can display "All" or something similar - indicating to the user that nothing is filtered. e.g.:
This issue has existed at least as far back as v 14.
Reproduction
StackBlitz link: https://stackblitz.com/edit/4mzrpg?file=src%2Fexample%2Fselect-overview-example.html
Steps to reproduce:
Expected Behavior
Mat-select should correctly reflect a null value like a native select
Actual Behavior
Mat-select shows no option selected
Environment
The text was updated successfully, but these errors were encountered: