Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mat-select): Allow values to be displayed that are not included in the options list #27142

Open
Halanson opened this issue May 23, 2023 · 0 comments
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

Comments

@Halanson
Copy link

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.

@Halanson Halanson added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels May 23, 2023
@andrewseguin andrewseguin added P4 A relatively minor issue that is not relevant to core functions area: material/select and removed needs triage This issue needs to be triaged by the team labels May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
2 participants