From ee0467d7a3a43b2a96673fef8ab6e629aa3675ef Mon Sep 17 00:00:00 2001 From: chaishi <974383157@qq.com> Date: Tue, 12 Dec 2023 21:26:39 +0800 Subject: [PATCH 1/2] fix(table): fix virtual scroll table can not expand tree nodes --- src/hooks/useVirtualScroll.ts | 2 +- src/table/hooks/useTreeDataExpand.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useVirtualScroll.ts b/src/hooks/useVirtualScroll.ts index 617e8e669f..a8b41597a2 100644 --- a/src/hooks/useVirtualScroll.ts +++ b/src/hooks/useVirtualScroll.ts @@ -179,7 +179,7 @@ const useVirtualScroll = (container: MutableRefObject, params: UseV }, 1); }, // eslint-disable-next-line - [container, data, tScroll, isVirtualScroll], + [container.current, data, tScroll, isVirtualScroll, startAndEndIndex, trHeightList, tripleBufferSize], ); return { diff --git a/src/table/hooks/useTreeDataExpand.ts b/src/table/hooks/useTreeDataExpand.ts index 9afa47b1ed..c260807137 100644 --- a/src/table/hooks/useTreeDataExpand.ts +++ b/src/table/hooks/useTreeDataExpand.ts @@ -119,7 +119,7 @@ export function useTreeDataExpand( if (changedExpandTreeNode.type === 'user-reaction-change') { const { row, rowIndex } = changedExpandTreeNode || {}; const newData = store.toggleExpandData({ row, rowIndex }, dataSource, rowDataKeys); - setDataSource(newData); + setDataSource([...newData]); } else if (changedExpandTreeNode.type === 'props-change') { updateExpandState(dataSource, tExpandedTreeNode, oldExpandedTreeNode); } From 308125372fe604e4336eb01752bc14fd77874526 Mon Sep 17 00:00:00 2001 From: chaishi <974383157@qq.com> Date: Tue, 12 Dec 2023 21:28:36 +0800 Subject: [PATCH 2/2] fix(table): container --- src/hooks/useVirtualScroll.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useVirtualScroll.ts b/src/hooks/useVirtualScroll.ts index a8b41597a2..b219ea58a3 100644 --- a/src/hooks/useVirtualScroll.ts +++ b/src/hooks/useVirtualScroll.ts @@ -179,7 +179,7 @@ const useVirtualScroll = (container: MutableRefObject, params: UseV }, 1); }, // eslint-disable-next-line - [container.current, data, tScroll, isVirtualScroll, startAndEndIndex, trHeightList, tripleBufferSize], + [container, data, tScroll, isVirtualScroll, startAndEndIndex, trHeightList, tripleBufferSize], ); return {