-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
bug(MatSelectionList): material auto unchecked option when options rebuild #19828
Labels
area: material/list
needs investigation
A member of the team needs to do further investigation to determine the root cause
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
swseverance
pushed a commit
to swseverance/material2
that referenced
this issue
Jul 6, 2020
…anged (angular#19828) When the value of a `mat-list-option` is updated, the `mat-selection-list` `compareWith` function should be used to compare the new value with the old value. This prevents options from being incorrectly unselected when the option value is updated.
swseverance
pushed a commit
to swseverance/material2
that referenced
this issue
Jul 6, 2020
When the value of a `mat-list-option` is updated, the `mat-selection-list` `compareWith` function should be used to compare the new value with the old value. This prevents options from being incorrectly unselected when the option value is updated.
swseverance
pushed a commit
to swseverance/material2
that referenced
this issue
Jul 7, 2020
When the value of a `mat-list-option` is updated, the `mat-selection-list` `compareWith` function should be used to compare the new value with the old value. This prevents options from being incorrectly unselected when the option value is updated.
mmalerba
pushed a commit
that referenced
this issue
Jul 10, 2020
When the value of a `mat-list-option` is updated, the `mat-selection-list` `compareWith` function should be used to compare the new value with the old value. This prevents options from being incorrectly unselected when the option value is updated.
wagnermaciel
pushed a commit
that referenced
this issue
Aug 20, 2020
When the value of a `mat-list-option` is updated, the `mat-selection-list` `compareWith` function should be used to compare the new value with the old value. This prevents options from being incorrectly unselected when the option value is updated.
wagnermaciel
pushed a commit
that referenced
this issue
Aug 20, 2020
When the value of a `mat-list-option` is updated, the `mat-selection-list` `compareWith` function should be used to compare the new value with the old value. This prevents options from being incorrectly unselected when the option value is updated. (cherry picked from commit f9c5ffe)
wagnermaciel
pushed a commit
to wagnermaciel/components
that referenced
this issue
Jan 14, 2021
…#19870) When the value of a `mat-list-option` is updated, the `mat-selection-list` `compareWith` function should be used to compare the new value with the old value. This prevents options from being incorrectly unselected when the option value is updated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: material/list
needs investigation
A member of the team needs to do further investigation to determine the root cause
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Reproduction
Use StackBlitz to reproduce your issue: https://stackblitz.com/fork/components-issue
https://stackblitz.com/edit/angular-puxzxe?file=src%2Fapp%2Flist-selection-example.html
Steps to reproduce:
Expected Behavior
all options checked
Actual Behavior
only last option checked, others be unchecked (don't understand why)
Detail:

I'm trying to do a select options, and it able to "add and select new option".
the final look is something like below.
above stackblitz is minimized reproduction.
I found that, it only happens when "trackBy" + [value], if i remove trackBy then working good.
or if i don't use [value] also working good
Environment
Angular CLI: 10.0.0
Node: 12.18.0
OS: win32 x64
Angular: 10.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes
Package Version
@angular-devkit/architect 0.1000.0
@angular-devkit/build-angular 0.1000.0
@angular-devkit/build-ng-packagr 0.1000.0
@angular-devkit/build-optimizer 0.1000.0
@angular-devkit/build-webpack 0.1000.0
@angular-devkit/core 10.0.0
@angular-devkit/schematics 10.0.0
@angular/cdk 10.0.1
@angular/cli 10.0.0
@angular/material 10.0.1
@angular/material-moment-adapter 10.0.1
@ngtools/webpack 10.0.0
@schematics/angular 10.0.0
@schematics/update 0.1000.0
ng-packagr 10.0.0
rxjs 6.5.5
typescript 3.9.5
webpack 4.43.0
The text was updated successfully, but these errors were encountered: