Skip to content

Commit

Permalink
fix extra bulk row selection events
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Feb 5, 2024
1 parent c404f7d commit 87b2cc8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/material-react-table/src/utils/row.utils.ts
Expand Up @@ -184,8 +184,12 @@ export const getMRT_RowSelectionHandler =
lastIndex < currentIndex
? [lastIndex, currentIndex]
: [currentIndex, lastIndex];
for (let i = start; i <= end; i++) {
rows[i].toggleSelected(!isChecked);
if (
rows[currentIndex].getIsSelected() !== rows[lastIndex].getIsSelected()
) {
for (let i = start; i <= end; i++) {
rows[i].toggleSelected(!isChecked);
}
}
}
}
Expand Down

0 comments on commit 87b2cc8

Please sign in to comment.