diff --git a/packages/web/src/components/treeView.tsx b/packages/web/src/components/treeView.tsx index e6cf557e99..b57a56404a 100644 --- a/packages/web/src/components/treeView.tsx +++ b/packages/web/src/components/treeView.tsx @@ -331,6 +331,8 @@ function indexTree( if (isVisible && !isVisible(parent)) return; for (const item of parent.children as T[]) { + if (isVisible && !isVisible(item)) + continue; const expandState = temporaryExpanded.has(item.id) || expandedItems.get(item.id); const autoExpandMatches = autoExpandDepth > depth && result.size < 25 && expandState !== false; const expanded = item.children.length ? expandState ?? autoExpandMatches : undefined;