Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] Fix deselection not working with isRowSelectable #15692

Merged
merged 9 commits into from
Dec 3, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@ const GridHeaderCheckbox = React.forwardRef<HTMLButtonElement, GridColumnHeaderP
// Convert to an object to make O(1) checking if a row exists or not
// TODO create selector that returns visibleRowIds/paginatedVisibleRowIds as an object
return rowIds.reduce<Record<GridRowId, true>>((acc, id) => {
const isSelectable = apiRef.current.isRowSelectable(id);
if (!isSelectable) {
MBilalShafi marked this conversation as resolved.
Show resolved Hide resolved
return acc;
}
acc[id] = true;
return acc;
}, {});
}, [
apiRef,
rootProps.pagination,
rootProps.checkboxSelectionVisibleOnly,
paginatedVisibleRowIds,
Expand Down