Skip to content

Commit 26a9191

Browse files
fix
1 parent d8ff895 commit 26a9191

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

chrome/src/components/TreeView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const TreeViewImpl = memo(({ onScroll, data, onMount }: { onScroll: () => void;
9999
onMount(ref.current as VirtuosoHandle);
100100

101101
return () => onMount();
102-
}, [onMount]);
102+
}, [onMount, index]);
103103

104104
return (
105105
<Virtuoso

chrome/src/components/TreeViewSearch.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ export const TreeViewSearch = memo(({ handle }: { handle?: VirtuosoHandle }) =>
6363

6464
useEffect(() => {
6565
if (itemIndex !== undefined) {
66-
handle?.scrollToIndex({ index: itemIndex });
67-
6866
setSelect(id, true);
67+
68+
handle?.scrollToIndex({ index: itemIndex, align: "center" });
6969
}
7070
}, [itemIndex, handle, id]);
7171

0 commit comments

Comments
 (0)