Fix: Searchbar not working (#3270) (#3306)

This commit is contained in:
Nilesh
2025-05-05 20:45:51 +05:30
committed by GitHub
parent 14943e3c55
commit b8b16be24b
3 changed files with 137 additions and 0 deletions

View File

@ -29,4 +29,30 @@ function Invoke-WPFTab {
}
}
$sync.currentTab = $sync.$tabNav.Items[$tabNumber].Header
# Always reset the filter for the current tab
if ($sync.currentTab -eq "Install") {
# Reset Install tab filter
Find-AppsByNameOrDescription -SearchString ""
} elseif ($sync.currentTab -eq "Tweaks") {
# Reset Tweaks tab filter
Find-TweaksByNameOrDescription -SearchString ""
}
# Show search bar in Install and Tweaks tabs
if ($tabNumber -eq 0 -or $tabNumber -eq 1) {
$sync.SearchBar.Visibility = "Visible"
$searchIcon = ($sync.Form.FindName("SearchBar").Parent.Children | Where-Object { $_ -is [System.Windows.Controls.TextBlock] -and $_.Text -eq [char]0xE721 })[0]
if ($searchIcon) {
$searchIcon.Visibility = "Visible"
}
} else {
$sync.SearchBar.Visibility = "Collapsed"
$searchIcon = ($sync.Form.FindName("SearchBar").Parent.Children | Where-Object { $_ -is [System.Windows.Controls.TextBlock] -and $_.Text -eq [char]0xE721 })[0]
if ($searchIcon) {
$searchIcon.Visibility = "Collapsed"
}
# Hide the clear button if it's visible
$sync.SearchBarClearButton.Visibility = "Collapsed"
}
}