From 3d535f2296010fc80312bc6041c5a6e6b1c26ac4 Mon Sep 17 00:00:00 2001 From: Steven Wijaya Date: Mon, 15 Sep 2025 21:32:46 +0700 Subject: [PATCH] Fix calculation of leafRows in getGroupedRowModel --- packages/table-core/src/utils/getGroupedRowModel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/table-core/src/utils/getGroupedRowModel.ts b/packages/table-core/src/utils/getGroupedRowModel.ts index da97631913..810fbd4afe 100644 --- a/packages/table-core/src/utils/getGroupedRowModel.ts +++ b/packages/table-core/src/utils/getGroupedRowModel.ts @@ -72,7 +72,7 @@ export function getGroupedRowModel(): ( }) // Flatten the leaf rows of the rows in this group - const leafRows = depth + const leafRows = groupedRows.some((row) => row.subRows.length > 0) ? flattenBy(groupedRows, row => row.subRows) : groupedRows