Skip to content

Commit 5c43c9c

Browse files
author
csl666
committed
Merge branch 'fix/row-expanding-bug' of https://github.com/ugjjffu/table into fix/row-expanding-bug
2 parents 15f4c80 + 79797d1 commit 5c43c9c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/table-core/src/features/RowExpanding.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,12 @@ export const RowExpanding: TableFeature = {
311311
}
312312

313313
if (exists && !expanded) {
314-
const { [row.id]: _, ...rest } = oldExpanded
315-
return rest
314+
return Object.keys(oldExpanded).reduce((acc, rowId) => {
315+
if (rowId !== row.id && !rowId.startsWith(row.id + '.')) {
316+
acc[rowId] = oldExpanded[rowId];
317+
}
318+
return acc;
319+
}, {} as ExpandedStateList);
316320
}
317321

318322
return old

0 commit comments

Comments
 (0)