Skip to content

fix(cdk/collections): add ability to bulk select/deselect values#33469

Merged
crisbeto merged 1 commit into
angular:mainfrom
crisbeto:33466/bulk-select
Jul 1, 2026
Merged

fix(cdk/collections): add ability to bulk select/deselect values#33469
crisbeto merged 1 commit into
angular:mainfrom
crisbeto:33466/bulk-select

Conversation

@crisbeto

@crisbeto crisbeto commented Jul 1, 2026

Copy link
Copy Markdown
Member

Currently the selection model expects values to be spread into the select, deselect and setSelection methods. This works fine for single values, but can cause an error if the user tries to spread a huge array, because it can hit browser limitations.

These changes expose a .bulk member on the list that accepts arrays instead of spreads. We need to do it this way, rather than add an array signature to the existing methods, because the selection model might be working with arrays already and we'd have no way of distinguishing them.

Fixes #33466.

Currently the selection model expects values to be spread into the `select`, `deselect` and `setSelection` methods. This works fine for single values, but can cause an error if the user tries to spread a huge array, because it can hit browser limitations.

These changes expose a `.bulk` member on the list that accepts arrays instead of spreads. We need to do it this way, rather than add an array signature to the existing methods, because the selection model might be working with arrays already and we'd have no way of distinguishing them.

Fixes angular#33466.
@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Jul 1, 2026
@pullapprove pullapprove Bot requested review from andrewseguin and tjshiu July 1, 2026 07:42
@crisbeto crisbeto requested a review from ok7sai July 1, 2026 07:42
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Jul 1, 2026
@crisbeto crisbeto merged commit 864dcad into angular:main Jul 1, 2026
34 of 36 checks passed
@crisbeto

crisbeto commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

This PR was merged into the repository. The changes were merged into the following branches:

crisbeto added a commit that referenced this pull request Jul 1, 2026
)

Currently the selection model expects values to be spread into the `select`, `deselect` and `setSelection` methods. This works fine for single values, but can cause an error if the user tries to spread a huge array, because it can hit browser limitations.

These changes expose a `.bulk` member on the list that accepts arrays instead of spreads. We need to do it this way, rather than add an array signature to the existing methods, because the selection model might be working with arrays already and we'd have no way of distinguishing them.

Fixes #33466.

(cherry picked from commit 864dcad)
essjay05 pushed a commit to essjay05/angular-components that referenced this pull request Jul 1, 2026
…ular#33469)

Currently the selection model expects values to be spread into the `select`, `deselect` and `setSelection` methods. This works fine for single values, but can cause an error if the user tries to spread a huge array, because it can hit browser limitations.

These changes expose a `.bulk` member on the list that accepts arrays instead of spreads. We need to do it this way, rather than add an array signature to the existing methods, because the selection model might be working with arrays already and we'd have no way of distinguishing them.

Fixes angular#33466.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: cdk/collections target: patch This PR is targeted for the next patch release

2 participants