File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
packages/table-core/src/features Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,9 @@ export const RowExpanding: TableFeature = {
208208 } )
209209 }
210210 }
211- table . setExpanded = updater => table . options . onExpandedChange ?.( updater )
211+ table . setExpanded = updater => {
212+ return table . options . onExpandedChange ?.( updater )
213+ }
212214 table . toggleAllRowsExpanded = expanded => {
213215 if ( expanded ?? ! table . getIsAllRowsExpanded ( ) ) {
214216 table . setExpanded ( true )
@@ -294,8 +296,11 @@ export const RowExpanding: TableFeature = {
294296 let oldExpanded : ExpandedStateList = { }
295297
296298 if ( old === true ) {
297- Object . keys ( table . getRowModel ( ) . rowsById ) . forEach ( rowId => {
298- oldExpanded [ rowId ] = true
299+ const rowIds = table . getRowModel ( ) . rowsById
300+ Object . keys ( rowIds ) . forEach ( rowId => {
301+ if ( rowIds [ rowId ] ?. getCanExpand ( ) ) {
302+ oldExpanded [ rowId ] = true
303+ }
299304 } )
300305 } else {
301306 oldExpanded = old
You can’t perform that action at this time.
0 commit comments