From 58baef6ceabd7ed506c2db6fa20133879a5fa73f Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Fri, 17 Jul 2026 19:30:08 -0500 Subject: [PATCH] fix(table-core): expand rows with manual pagination --- .../row-expanding/createExpandedRowModel.ts | 3 ++- .../createPaginatedRowModel.test.ts | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/table-core/src/features/row-expanding/createExpandedRowModel.ts b/packages/table-core/src/features/row-expanding/createExpandedRowModel.ts index 093b8fbed9..bf3df84990 100644 --- a/packages/table-core/src/features/row-expanding/createExpandedRowModel.ts +++ b/packages/table-core/src/features/row-expanding/createExpandedRowModel.ts @@ -25,6 +25,7 @@ export function createExpandedRowModel< table.atoms.expanded?.get(), table.getPreExpandedRowModel(), table.options.paginateExpandedRows, + table.options.manualPagination, ], fn: () => _createExpandedRowModel(table), }) @@ -45,7 +46,7 @@ function _createExpandedRowModel< return rowModel } - if (!table.options.paginateExpandedRows) { + if (!table.options.paginateExpandedRows && !table.options.manualPagination) { // Only expand rows at this point if they are being paginated return rowModel } diff --git a/packages/table-core/tests/implementation/features/row-pagination/createPaginatedRowModel.test.ts b/packages/table-core/tests/implementation/features/row-pagination/createPaginatedRowModel.test.ts index 45c9132f23..e9ed3f5284 100644 --- a/packages/table-core/tests/implementation/features/row-pagination/createPaginatedRowModel.test.ts +++ b/packages/table-core/tests/implementation/features/row-pagination/createPaginatedRowModel.test.ts @@ -232,5 +232,23 @@ describe('createPaginatedRowModel', () => { '4', ]) }) + + it('should include expanded children when expanded rows bypass manual pagination', () => { + const table = createTable({ + data: makeNestedData(), + manualPagination: true, + paginateExpandedRows: false, + }) + + table.getRow('0').toggleExpanded() + + expect(table.getRowModel().rows.map((row) => row.id)).toEqual([ + '0', + '0.0', + '0.1', + '1', + '2', + ]) + }) }) })