-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[Select] Custom text for multiple selected values #6218
Comments
Duplicate of #2275 |
I think this is somewhat different. Does it really solve my issue if I can specify how the selected values should be rendered? Still they will be concatenated or do I get it wrong? |
Yeah I see the distinction now, good call. I know I'd seen a similar request (#2722 (comment)) but it doesn't look like there's issue tracking for it yet! |
@willshowell: Any ideas on the implementation? What would fit best? Should the text be included by material and then i18n-ized or should we have a callback? |
I feel like a callback similar to autocomplete's |
add input property to set a callback which will display a custom text if multiple values are selected. Similar to MdAutocomplete.displayWith. fixes angular#6218
add input property to set a callback which will display a custom text if multiple values are selected. Similar to MdAutocomplete.displayWith. fixes angular#6218
add input property to set a callback which will display a custom text if multiple values are selected. Similar to MdAutocomplete.displayWith. fixes angular#6218
will be fixed by #3341 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Feature request: Make it possible to adjust the text which is shown if multiple values are selected in MdSelect.
What is the expected behavior?
When all values are selected, the text is "[all] selected.
When more than 2 values are selected the text is "2 selected".
What is the current behavior?
All values are shown, seperated by
,
, if they won't fit, ellipses are applied.What are the steps to reproduce?
Go to the plunk and select all values.
What is the use-case or motivation for changing an existing behavior?
To our customers it is more useful to see how many values are selected (whether or not all are selected), rather than seeing only the first part of the text of the first selected item.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
master
Is there anything else we should know?
I already tried extending MdSelect. I think this is the best option, but I got stuck on all the errors in the (copied) template :(
Another option would be to have a callback as input property which is evaluated as part of triggerValue upon changes ...
I can also work on a PR if this is something which is required by others as well and if you have some guidance on the best option ...
The text was updated successfully, but these errors were encountered: