Table: Fix nested table bug (#105133)

chore: remove expandedKey index for key rerendering
pull/105492/head
Alex Spencer 2 months ago committed by GitHub
parent a32b379177
commit 0041c7e9b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      packages/grafana-ui/src/components/Table/TableRT/RowsList.tsx

@ -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}

Loading…
Cancel
Save