Skip to content

Commit 1c87ded

Browse files
chore: ignore debounce for empty input (#299)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent c03d6ca commit 1c87ded

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/pages/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const debouncedNavigate = debounce(() => {
1414
}, 250)
1515
1616
function handleSearch() {
17-
debouncedNavigate()
17+
// If input is empty, navigate immediately (no need to debounce)
18+
return searchQuery.value.trim() ? debouncedNavigate() : router.push('/search')
1819
}
1920
2021
useSeoMeta({

0 commit comments

Comments
 (0)