-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(list): selection list not marking options as selected correctly when setting value with duplicates #13363
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
fix(list): selection list not marking options as selected correctly when setting value with duplicates #13363
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…hen setting value with duplicates Along the same lines as angular#13361. Fixes the selection list not marking all selected options correctly when an array with duplicate values is assigned programmatically.
776f885
to
411554d
Compare
listOptions = fixture.debugElement.queryAll(By.directive(MatListOption)) | ||
.map(optionDebugEl => optionDebugEl.componentInstance); | ||
|
||
fixture.componentInstance.selectedOptions = ['one', 'two', 'two']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would this look like if I wanted to select only the second "two" value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That wouldn't be possible, it'll always hit the first one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…hen setting value with duplicates (angular#13363) Along the same lines as angular#13361. Fixes the selection list not marking all selected options correctly when an array with duplicate values is assigned programmatically.
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. |
Along the same lines as #13361. Fixes the selection list not marking all selected options correctly when an array with duplicate values is assigned programmatically.