fix(select): support objects as select values#7842
Conversation
1609c57 to
8b73e3b
Compare
There was a problem hiding this comment.
could you move it to the constructor?
Since id never changes, it is a bit confusing that you keep resetting it on every value change.
45eaaf9 to
6e017f6
Compare
|
@vsavkin All comments should be addressed. |
There was a problem hiding this comment.
Do you mean to use == or ===? Those two things are somewhat distinct in JS, and are very distinct in Dart.
There was a problem hiding this comment.
I did mean == to fix a Dart error, but thinking about it more, this is a bad solution. Obviously we don't want 6 to match "6". I'll fix it another way.
There was a problem hiding this comment.
I think I can remove this line, and the test will still pass. Can you verify that the selected option is actually Buffalo?
187aea6 to
aa05492
Compare
|
@jeffbcross Fixed the Edge issues. Should be ready! |
|
Merging PR #7842 on behalf of @vsavkin to branch presubmit-vsavkin-pr-7842. |
|
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. |
This fixes a current bug where objects set as option values and/or
[(ngModel)]on select tags are converted to[object Object]strings.For the following:
You might expect the select to display "Salt", but it displays "Pepper" because all option values are set to
[object Object]. When selecting new options using the dropdown, theselectedproperty on the component class is set to[object Object].This PR allows you to write the above code and have the selection updated on both ends as expected.
No breaking changes.