Skip to content

Commit

Permalink
Merge pull request #4009 from Ginger-Automation/Enhancement/ExpandTre…
Browse files Browse the repository at this point in the history
…eFolderOnSearchMatch

Enhancement - Expand Tree Folder On Text Search
  • Loading branch information
Maheshkale447 authored Nov 29, 2024
2 parents 55fe78a + 04cb7aa commit 9ab9464
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Ginger/Ginger/UserControlsLib/UCTreeView/UCTreeView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,18 @@ private bool FilterItemsByTextNew(IEnumerable<ITreeViewItem> items, string text)
wasFound = true;
}

if (FilterItemsByTextNew(item.Childrens(), text))
bool foundMatchInChildren = FilterItemsByTextNew(item.Childrens(), text);
if (foundMatchInChildren)
{
wasFound = true;
itemBase.Visibility = Visibility.Visible;
}

bool canExpand = item.IsExpandable() && itemBase.TreeViewItem != null;
if (foundMatchInChildren && canExpand)
{
itemBase.TreeViewItem!.IsExpanded = true;
}
}

return wasFound;
Expand Down

0 comments on commit 9ab9464

Please sign in to comment.