Table: Fix nested table bug (#105133)

chore: remove expandedKey index for key rerendering
This commit is contained in:
Alex Spencer
2025-05-15 08:50:54 -07:00
committed by GitHub
parent a32b379177
commit 0041c7e9b7
@@ -422,9 +422,6 @@ export const RowsList = (props: RowsListProps) => {
}
};
// Key the virtualizer for expanded rows
const expandedKey = Object.keys(tableState.expanded).join('|');
// It's a hack for text wrapping.
// VariableSizeList component didn't know that we manually set row height.
// So we need to reset the list when the rows high changes.
@@ -437,8 +434,7 @@ export const RowsList = (props: RowsListProps) => {
return (
<CustomScrollbar onScroll={handleScroll} hideHorizontalTrack={true} scrollTop={scrollTop}>
<VariableSizeList
// This component needs an unmount/remount when row height, page changes, or expanded rows change
key={`${rowHeight}${pageIndex}${expandedKey}`}
key={`${rowHeight}${pageIndex}`}
height={listHeight}
itemCount={itemCount}
itemSize={getItemSize}