Skip to content

Commit

Permalink
Remove dependency on binded selector
Browse files Browse the repository at this point in the history
  • Loading branch information
MBilalShafi committed Feb 13, 2025
1 parent 644fa7c commit 97c44da
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ export const useGridRowSelection = (
return false;
}

const rowNode = tree[id];
const rowNode = gridRowTreeSelector(apiRef)[id];
if (rowNode?.type === 'footer' || rowNode?.type === 'pinnedRow') {
return false;
}

return true;
},
[apiRef, tree, props.rowSelection, propIsRowSelectable],
[apiRef, props.rowSelection, propIsRowSelectable],
);

const getSelectedRows = React.useCallback<GridRowSelectionApi['getSelectedRows']>(
Expand Down Expand Up @@ -574,7 +574,7 @@ export const useGridRowSelection = (
}
}

const rowNode = tree[params.id];
const rowNode = gridRowTreeSelector(apiRef)[params.id];
if (rowNode!.type === 'pinnedRow') {
return;
}
Expand All @@ -591,7 +591,6 @@ export const useGridRowSelection = (
apiRef,
expandMouseRowRangeSelection,
handleSingleRowSelection,
tree,
],
);

Expand Down

0 comments on commit 97c44da

Please sign in to comment.