Skip to content

Commit

Permalink
Create another object for the state update to trigger cell selection …
Browse files Browse the repository at this point in the history
…event properly
  • Loading branch information
arminmeh committed Aug 14, 2024
1 parent 10d946e commit 13c0a01
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const useGridCellSelection = (
const rowsInRange = visibleRows.rows.slice(finalStartRowIndex, finalEndRowIndex + 1);
const columnsInRange = visibleColumns.slice(finalStartColumnIndex, finalEndColumnIndex + 1);

const newModel = keepOtherSelected ? apiRef.current.getCellSelectionModel() : {};
const newModel = keepOtherSelected ? { ...apiRef.current.getCellSelectionModel() } : {};

rowsInRange.forEach((row) => {
if (!newModel[row.id]) {
Expand Down

0 comments on commit 13c0a01

Please sign in to comment.