Skip to content

Commit

Permalink
[DataGrid] Fix failing CI (#15273)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi authored Nov 5, 2024
1 parent 8acff87 commit f50938c
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ export const useGridRowSelection = (
}
const currentLookup = selectedIdsLookupSelector(apiRef);
if (
newSelection.length === Object.keys(currentLookup).length &&
newSelection.every((id) => currentLookup[id] === id)
newSelection.size === Object.keys(currentLookup).length &&
Array.from(newSelection).every((id) => currentLookup[id] === id)
) {
return;
}
Expand Down Expand Up @@ -504,11 +504,10 @@ export const useGridRowSelection = (
// Example: A parent whose de-selected children are filtered out should now be selected
const shouldReapplyPropagation =
isNestedData &&
!sortModelUpdated &&
props.rowSelectionPropagation?.parents &&
Object.keys(selectionLookup).length > 0;

if (hasChanged || shouldReapplyPropagation) {
if (hasChanged || (shouldReapplyPropagation && !sortModelUpdated)) {
const newSelection = Object.values(selectionLookup);
if (shouldReapplyPropagation) {
apiRef.current.selectRows(newSelection, true, true);
Expand Down

0 comments on commit f50938c

Please sign in to comment.