Skip to content

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

Merged

Conversation

crisbeto
Copy link
Member

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.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Sep 29, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 29, 2018
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@devversion devversion added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Sep 29, 2018
…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.
@crisbeto crisbeto force-pushed the selection-list-duplicate-values branch from 776f885 to 411554d Compare September 29, 2018 13:50
listOptions = fixture.debugElement.queryAll(By.directive(MatListOption))
.map(optionDebugEl => optionDebugEl.componentInstance);

fixture.componentInstance.selectedOptions = ['one', 'two', 'two'];
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vivian-hu-zz vivian-hu-zz merged commit bef9a17 into angular:master Oct 3, 2018
roboshoes pushed a commit to roboshoes/material2 that referenced this pull request Oct 23, 2018
…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.
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants