-
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(selection-model): SelectionModel does not always respect the compareWith function #25878
Labels
area: cdk/collections
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
stijnvn
added a commit
to stijnvn/components
that referenced
this issue
Oct 27, 2022
…r deselecting values Fixes angular#25878
zarend
added
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
area: cdk/collections
and removed
needs triage
This issue needs to be triaged by the team
labels
Oct 27, 2022
Suboptimal workaround until this use is solved: https://stackblitz.com/edit/components-issue-rkekpt?file=src%2Fapp%2Fexample-component.ts |
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 17, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 17, 2023
…compareWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 17, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 19, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 21, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 25, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 25, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 25, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 26, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 26, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 26, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 26, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
FrenchTechLead
added a commit
to FrenchTechLead/components
that referenced
this issue
Jan 27, 2023
…areWith function Fixed bug in SelectionModel where compareWith function was not consistently respected in deselect method. Fixes angular#25878
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: cdk/collections
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
SelectionModel does not always respect the
compareWith
function.The lines in SelectionModel where it goes wrong:
https://github.com/angular/components/blob/14.1.3/src/cdk/collections/selection-model.ts#L212
https://github.com/angular/components/blob/14.1.3/src/cdk/collections/selection-model.ts#L97
Reproduction
https://stackblitz.com/edit/components-issue-8zah2s?file=src/app/example-component.ts
Steps to reproduce:
compareWith
function.Expected Behavior
The item is deselected because it is equal to the original item according to the
compareWith
function.Actual Behavior
The item is not deselected because the current implementation uses
Set.delete
to remove the item.Environment
The text was updated successfully, but these errors were encountered: