Skip to content

Commit e0b85b5

Browse files
committed
fix: make searches work without JS
1 parent c008b45 commit e0b85b5

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

app/components/AppHeader.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ onKeyStroke(',', e => {
6767
<div class="flex-1 flex items-center justify-center gap-4 sm:gap-6">
6868
<!-- Search bar (shown on all pages except home and search) -->
6969
<search v-if="showSearchBar" class="hidden sm:block flex-1 max-w-md">
70-
<form role="search" method="GET" action="/search" class="relative">
70+
<form
71+
role="search"
72+
method="GET"
73+
action="/search"
74+
class="relative"
75+
@submit.prevent="handleSearchInput"
76+
>
7177
<label for="header-search" class="sr-only">
7278
{{ $t('search.label') }}
7379
</label>

app/pages/index.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ defineOgImageComponent('Default')
4141
class="w-full max-w-xl motion-safe:animate-slide-up motion-safe:animate-fill-both"
4242
style="animation-delay: 0.2s"
4343
>
44-
<form role="search" class="relative" @submit.prevent="handleSearch">
44+
<form
45+
role="search"
46+
method="GET"
47+
action="/search"
48+
class="relative"
49+
@submit.prevent="handleSearch"
50+
>
4551
<label for="home-search" class="sr-only">
4652
{{ $t('search.label') }}
4753
</label>

app/pages/search.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ defineOgImageComponent('Default', {
706706
<h1 class="font-mono text-xl sm:text-2xl font-medium mb-4">search</h1>
707707

708708
<search>
709-
<form role="search" class="relative" @submit.prevent>
709+
<form role="search" method="GET" action="/search" class="relative" @submit.prevent>
710710
<label for="search-input" class="sr-only">{{ $t('search.label') }}</label>
711711

712712
<div class="relative group" :class="{ 'is-focused': isSearchFocused }">

0 commit comments

Comments
 (0)