fix: preserve active nav category when clearing search via nav click

This commit is contained in:
Jin Yi
2026-02-10 18:00:15 +09:00
parent 816c5aac97
commit 442f2d6e2c

View File

@@ -190,7 +190,11 @@ function sortedGroups(category: SettingTreeNode): ISettingGroup[] {
function handleSearch(query: string) {
handleSearchBase(query.trim())
activeCategoryKey.value = query ? null : (defaultCategory.value?.key ?? null)
if (query) {
activeCategoryKey.value = null
} else if (!activeCategoryKey.value) {
activeCategoryKey.value = defaultCategory.value?.key ?? null
}
}
function onNavItemClick(id: string) {