From 0e0c8dc6357846997533f82aeea6da64d315034a Mon Sep 17 00:00:00 2001 From: Simon Guo Date: Tue, 17 Oct 2023 09:40:47 +0800 Subject: [PATCH] fix(TreeTable): fix incorrect scrolling position of tree nodes after collapse (#462) --- src/Table.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Table.tsx b/src/Table.tsx index aa80a5d..420060a 100644 --- a/src/Table.tsx +++ b/src/Table.tsx @@ -417,7 +417,9 @@ const Table = React.forwardRef((props: TableProps< setScrollX, getTableHeight } = useTableDimension({ - data: dataProp, + // The data should be flattened, + // otherwise the array length required to calculate the scroll height in the TreeTable is not real. + data, width: widthProp, rowHeight, tableRef,