Skip to content

Commit 28dfeae

Browse files
committed
Fix for scrolling when filtered
1 parent 7dabb49 commit 28dfeae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/webapp/app/components/primitives/TreeView/TreeView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ export function useTree<TData, TFilterValue>({
246246

247247
const scrollToNodeFn = useCallback(
248248
(id: string) => {
249-
const itemIndex = tree.findIndex((node) => node.id === id);
249+
const itemIndex = state.visibleNodeIds.findIndex((n) => n === id);
250250

251251
if (itemIndex !== -1) {
252252
virtualizer.scrollToIndex(itemIndex, { align: "auto" });

0 commit comments

Comments
 (0)