improve search on mobile (#4632)

This commit is contained in:
bread
2026-01-24 11:51:15 -08:00
committed by GitHub
parent 39599b2103
commit ecc03b0451
2 changed files with 131 additions and 1 deletions

View File

@@ -402,6 +402,10 @@ function resetSearch() {
nextTick().then(() => focusSearchInput(false))
}
function handleInput(e: Event) {
filterText.value = (e.target as HTMLInputElement).value
}
function toggleFuzzySearch() {
isFuzzySearch.value = !isFuzzySearch.value
}
@@ -464,7 +468,8 @@ function onMouseMove(e: MouseEvent) {
</div>
<input
ref="searchInput"
v-model="filterText"
:value="filterText"
@input="handleInput"
:aria-activedescendant="selectedIndex > -1 ? ('localsearch-item-' + selectedIndex) : undefined"
aria-autocomplete="both"
:aria-controls="results?.length ? 'localsearch-list' : undefined"