Skip to content

[Select] Custom text for multiple selected values #6218

Closed
@davidreher

Description

@davidreher

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 ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions