Skip to content

Commit fdd92d4

Browse files
committed
fix: prevent reloading in search form
1 parent b914c04 commit fdd92d4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/components/Header/SearchBox.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ function handleSearchFocus() {
7979
emit('focus')
8080
}
8181
82+
function handleSubmit() {
83+
updateUrlQuery.flush()
84+
}
85+
8286
// Expose focus method for parent components
8387
const inputRef = shallowRef<HTMLInputElement | null>(null)
8488
function focus() {
@@ -88,7 +92,7 @@ defineExpose({ focus })
8892
</script>
8993
<template>
9094
<search v-if="showSearchBar" :class="'flex-1 sm:max-w-md ' + inputClass">
91-
<form method="GET" action="/search" class="relative">
95+
<form method="GET" action="/search" class="relative" @submit.prevent="handleSubmit">
9296
<label for="header-search" class="sr-only">
9397
{{ $t('search.label') }}
9498
</label>

0 commit comments

Comments
 (0)