From e0ccb83baafd3405dca3d4e3bf881a60f23a1bab Mon Sep 17 00:00:00 2001 From: vzanimonets Date: Tue, 19 Mar 2024 19:20:01 +0300 Subject: [PATCH] fix:[#1046] Sub Row Selection not working correctly --- packages/material-react-table/src/utils/row.utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/material-react-table/src/utils/row.utils.ts b/packages/material-react-table/src/utils/row.utils.ts index 576bc0060..25a09f686 100644 --- a/packages/material-react-table/src/utils/row.utils.ts +++ b/packages/material-react-table/src/utils/row.utils.ts @@ -131,11 +131,13 @@ export const getIsRowSelected = ({ table: MRT_TableInstance; }) => { const { - options: { enableRowSelection }, + options: { enableRowSelection, enableSubRowSelection }, } = table; return ( - row.getIsSelected() || + (enableSubRowSelection + ? row.getIsSelected() && !row.getCanExpand() + : row.getIsSelected()) || (parseFromValuesOrFunc(enableRowSelection, row) && row.getCanSelectSubRows() && row.getIsAllSubRowsSelected())