feat(mat-select): Allow values to be displayed that are not included in the options list #27142
Labels
area: material/select
feature
This issue represents a new feature or feature request rather than a bug or bug fix
P4
A relatively minor issue that is not relevant to core functions
Feature Description
We would like to show a value as "selected" only on the closed mat-select/mat-select-trigger that is not included in the available options list.
Here is an example that tries to achieve this.
https://stackblitz.com/edit/wmjgwt
If you change selectable to true (line 37) of select-overview-example.ts the viewValue and backgroundColor are shown in the closed mat-select as expected. Setting it to false shows only the backgroundColor but not the viewValue. We like to see the viewValue as well.
Use Case
a) Imagine a process A -> B -> C with a strict order and tasks following this process. Now you have a mat-select showing the current process step B and if you open the select box it should only show step C as available option. Currently the closed mat-select shows nothing, the opened mat-select shows step C.
b) Imagine a permission system where the user is allowed to select some options of a select box an some not. Here we could use the disabled option. But to make it easier for the user, not showing the options at all would also be handy.
The text was updated successfully, but these errors were encountered: