From 7066576a8a19f946f3724ee5695ad9c3c1ca373a Mon Sep 17 00:00:00 2001 From: yiling Date: Wed, 10 Jun 2026 16:26:56 +0800 Subject: [PATCH] fix(webui): configure list-view wrapper as the scroll element for virtualization --- packages/webui/components/file-browser/file-browser.tsx | 1 - packages/webui/components/file-browser/list-view.tsx | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/webui/components/file-browser/file-browser.tsx b/packages/webui/components/file-browser/file-browser.tsx index b943b2c4..8f1b2acd 100644 --- a/packages/webui/components/file-browser/file-browser.tsx +++ b/packages/webui/components/file-browser/file-browser.tsx @@ -824,7 +824,6 @@ export function FileBrowser({ handleEmptyAreaClick={handleEmptyAreaClick} dragState={dragState} sort={sort} - scrollContainerRef={scrollContainerRef} /> ) : ( void dragState?: DragState sort?: SearchSort - scrollContainerRef: React.RefObject } export function FileBrowserListView({ @@ -173,7 +172,6 @@ export function FileBrowserListView({ handleEmptyAreaClick, dragState, sort, - scrollContainerRef, }: FileBrowserListViewProps) { const [columnSizing, setColumnSizing] = useState>({}) @@ -253,9 +251,11 @@ export function FileBrowserListView({ return list }, [foldersExpanded, filesExpanded, folders.length, files.length, totalFolders, totalFiles]) + const localScrollRef = React.useRef(null) + const rowVirtualizer = useVirtualizer({ count: items.length, - getScrollElement: () => scrollContainerRef.current, + getScrollElement: () => localScrollRef.current, estimateSize: () => 40, overscan: 10, }) @@ -305,7 +305,7 @@ export function FileBrowserListView({ ]) return ( -
+