Select doesn't accept an array value
Bug, feature request, or proposal:
Bug
What is the expected behavior?
Should be able to set an array as the value of a select
What are the steps to reproduce?
https://plnkr.co/edit/lnj292JDLrd2SS0cPzNo?p=preview In select-overview-example.ts, see lines 19 and 20. When the preselected value is an array, it doesn't work.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Since, at-least, beta.8. Still in beta.12 Angular 4.4.4
Please see compareWith. By default MatSelect compares values by Object reference.
That's not the problem. I pass the same array with the same reference.
Looking at the sources, I think the problem is on select.ts:722. It should check this.multiple instead of isArray
Ah my bad! There have been lots of questions like that lately, so I didn't fully look it over.
cc @crisbeto
The assumption has always been that if you're providing an array value, you're probably in multiple mode, but I see how it's an issue.
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.