Skip to content

Commit 99cc5a8

Browse files
fix: improve reliability of searchbox (#307)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 4b05904 commit 99cc5a8

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

app/components/AppHeader.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const debouncedNavigate = debounce(async () => {
3030
name: 'search',
3131
query: query ? { q: query } : undefined,
3232
})
33-
searchQuery.value = ''
33+
// allow time for the navigation to occur before resetting searchQuery
34+
setTimeout(() => (searchQuery.value = ''), 1000)
3435
}, 100)
3536
3637
async function handleSearchInput() {

app/pages/search.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ const resultCount = computed(() => visibleResults.value?.objects.length ?? 0)
5656
// Track if page just loaded (for hiding "Searching..." during view transition)
5757
const hasInteracted = ref(false)
5858
onMounted(() => {
59+
// Focus search onMount
60+
isSearchFocused.value = true
5961
// Small delay to let view transition complete
6062
setTimeout(() => {
6163
hasInteracted.value = true

0 commit comments

Comments
 (0)