Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/every-grapes-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/table-core': major
---

fix API to calculate max expanded row depth
8 changes: 6 additions & 2 deletions packages/table-core/src/features/RowExpanding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,12 @@ export const RowExpanding: TableFeature = {
}

if (exists && !expanded) {
const { [row.id]: _, ...rest } = oldExpanded
return rest
return Object.keys(oldExpanded).reduce((acc, rowId) => {
if (rowId !== row.id && !rowId.startsWith(row.id + '.')) {
acc[rowId] = oldExpanded[rowId];
}
return acc;
}, {} as ExpandedStateList);
}

return old
Expand Down