components icon indicating copy to clipboard operation
components copied to clipboard

[MatSelect] Order in multiple mode

Open Howard-Song opened this issue 8 years ago • 3 comments

Bug, feature request, or proposal:

feature

What is the expected behavior?

Using MatSelect with multiple selection,(selectionChange) will give the result which sort by user selected order.

What is the current behavior?

When using MatSelect with multiple selection,(selectionChange) will give the result which sort by selected options order.I think this order should defined by developer,such as sort by user select or default options order.

What are the steps to reproduce?

Providing a StackBlitz reproduction is the best way to share your issue.
StackBlitz starter: https://goo.gl/wwnhMV

What is the use-case or motivation for changing an existing behavior?

Make select value sort rules defined by developer.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 6.0.0, Material: 6.0.1, OS: win10, TypeScript: 2.7.2, Browsers: [email protected]

Is there anything else we should know?

Howard-Song avatar Jun 21 '18 01:06 Howard-Song

You should be able to sort the values yourself when you get it in the selection change event.

crisbeto avatar Jun 21 '18 18:06 crisbeto

@crisbeto Yes, I have fixed by this way.But in <mat-selcect #select></mat-select> , It's only way to overwrite the text by select._elementRef.nativeElement.firstChild.firstChild.children[0].innerText = 'b,a,c'. In fact, I'm already finish this case,just give some advice for better component.

Howard-Song avatar Jun 22 '18 07:06 Howard-Song

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.