CardView - "Clear selection" button doesn't clear selection if the option method updates the selectedCardKeys property (T1306438)#33777
Open
markallenramirez wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes CardView selection synchronization so the “Clear selection” toolbar button correctly clears selection even when selectedCardKeys is updated at runtime via the option API.
Changes:
- Updated selection synchronization effect to react to
selectedCardKeyschanges (use reactive.valueinstead of.peek()). - Added an integration test covering “clear selection after runtime
selectedCardKeysoption update”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/new/grid_core/selection/controller.ts | Makes the post-load selection application track runtime selectedCardKeys updates. |
| packages/devextreme/js/__internal/grids/new/grid_core/selection/controller.integration.test.ts | Adds regression coverage for the toolbar “Clear selection” scenario after an option-based update. |
anna-shakhova
previously approved these changes
Jun 1, 2026
bfd7b0d to
14dabc6
Compare
6a4fba7 to
e6505fc
Compare
Comment on lines
+181
to
+203
| describe('clear selection toolbar button', () => { | ||
| it('should clear selection after runtime selectedCardKeys option update', () => { | ||
| const cardView = setup({ | ||
| keyExpr: 'id', | ||
| dataSource: [{ id: 1 }, { id: 2 }], | ||
| selection: { | ||
| mode: 'multiple', | ||
| }, | ||
| selectedCardKeys: [], | ||
| }); | ||
|
|
||
| expect(cardView.getSelectedCardKeys()).toEqual([]); | ||
|
|
||
| cardView.option('selectedCardKeys', [2]); | ||
|
|
||
| expect(cardView.getSelectedCardKeys()).toEqual([2]); | ||
|
|
||
| const clearSelectionButton = getClearSelectionButton(); | ||
| clearSelectionButton?.dispatchEvent(new MouseEvent('click')); | ||
|
|
||
| expect(cardView.getSelectedCardKeys()).toEqual([]); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.