diff --git a/packages/table-core/src/features/RowSelection.ts b/packages/table-core/src/features/RowSelection.ts index 90166823aa..e591951d70 100644 --- a/packages/table-core/src/features/RowSelection.ts +++ b/packages/table-core/src/features/RowSelection.ts @@ -635,6 +635,7 @@ export function isSubRowSelected( let allChildrenSelected = true let someSelected = false + let someSelectable = false row.subRows.forEach(subRow => { // Bail out early if we know both of these @@ -643,6 +644,7 @@ export function isSubRowSelected( } if (subRow.getCanSelect()) { + someSelectable = true if (isRowSelected(subRow, selection)) { someSelected = true } else { @@ -664,5 +666,7 @@ export function isSubRowSelected( } }) + if (!someSelectable) return false + return allChildrenSelected ? 'all' : someSelected ? 'some' : false }