[release-11.6.2] Table: Fix nested table bug (#105490)

Table: Fix nested table bug (#105133)

chore: remove expandedKey index for key rerendering
(cherry picked from commit 0041c7e9b7)
This commit is contained in:
Alex Spencer 2025-05-20 07:06:53 -07:00 committed by GitHub
parent e9b0b090c6
commit dfdc748ef3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 5 deletions

View File

@ -420,9 +420,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.
@ -435,8 +432,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}