Skip to content

Commit fa86f47

Browse files
authored
Merge pull request #9202 from IgniteUI/fix-issue-9139-11.1.x
Clear current selection when setting new selection state
2 parents fdd06bb + 0feeffd commit fa86f47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

projects/igniteui-angular/src/lib/grids/state.directive.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ describe('IgxGridState - input properties #grid', () => {
360360

361361
let gridState = state.getState(true, 'rowSelection');
362362
expect(gridState).toBe(initialState);
363-
363+
state.setState('{"rowSelection":[2]}');
364364
state.setState(rowSelectionState);
365365
gridState = state.getState(false, 'rowSelection');
366366
HelperFunctions.verifyRowSelection(grid.selectedRows, gridState as IGridState);

projects/igniteui-angular/src/lib/grids/state.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export class IgxGridStateDirective {
237237
return { rowSelection: selection };
238238
},
239239
restoreFeatureState: (context: IgxGridStateDirective, state: any[]): void => {
240-
context.currGrid.selectRows(state);
240+
context.currGrid.selectRows(state, true);
241241
}
242242
},
243243
cellSelection: {

0 commit comments

Comments
 (0)