Skip to content

Commit 4801787

Browse files
fix: search button disappears on homepage (#584)
Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent 7337dcb commit 4801787

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/components/AppHeader.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const isSearchExpandedManually = shallowRef(false)
2020
const searchBoxRef = shallowRef<{ focus: () => void } | null>(null)
2121
2222
// On search page, always show search expanded on mobile
23+
const isOnHomePage = computed(() => route.name === 'index')
2324
const isOnSearchPage = computed(() => route.name === 'search')
2425
const isSearchExpanded = computed(() => isOnSearchPage.value || isSearchExpandedManually.value)
2526
@@ -96,11 +97,12 @@ onKeyStroke(
9697
<header class="sticky top-0 z-50 bg-bg/80 backdrop-blur-md border-b border-border">
9798
<nav
9899
:aria-label="$t('nav.main_navigation')"
99-
class="container min-h-14 flex items-center justify-between gap-2"
100+
class="container min-h-14 flex items-center gap-2"
101+
:class="isOnHomePage ? 'justify-end' : 'justify-between'"
100102
>
101103
<!-- Mobile: Logo + search button (expands search, doesn't navigate) -->
102104
<button
103-
v-if="!isSearchExpanded"
105+
v-if="!isSearchExpanded && !isOnHomePage"
104106
type="button"
105107
class="sm:hidden flex-shrink-0 inline-flex items-center gap-2 font-mono text-lg font-medium text-fg hover:text-fg transition-colors duration-200 focus-ring rounded"
106108
:aria-label="$t('nav.tap_to_search')"

0 commit comments

Comments
 (0)