File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
packages/table-core/src/features Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -311,15 +311,12 @@ export const RowExpanding: TableFeature = {
311311 }
312312
313313 if ( exists && ! expanded ) {
314- const currentExpandedState = table . getState ( ) . expanded as ExpandedStateList ;
315- const rowIds = Object . keys ( currentExpandedState ) ;
316- const updatedExpandedState = rowIds . reduce ( ( acc , rowId ) => {
317- if ( ! rowId . startsWith ( row . id ) ) {
318- acc [ rowId ] = ! ! ( currentExpandedState [ rowId ] ) ;
314+ return Object . keys ( oldExpanded ) . reduce ( ( acc , rowId ) => {
315+ if ( rowId !== row . id && ! rowId . startsWith ( row . id + '.' ) ) {
316+ acc [ rowId ] = oldExpanded [ rowId ] ;
319317 }
320318 return acc ;
321319 } , { } as ExpandedStateList ) ;
322- return updatedExpandedState ;
323320 }
324321
325322 return old
You can’t perform that action at this time.
0 commit comments