Skip to content

Commit a500ca8

Browse files
fix(mobile): search button disappears on homepage
1 parent 0d06026 commit a500ca8

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
@@ -78,11 +79,12 @@ onKeyStroke(
7879
<header class="sticky top-0 z-50 bg-bg/80 backdrop-blur-md border-b border-border">
7980
<nav
8081
:aria-label="$t('nav.main_navigation')"
81-
class="container min-h-14 flex items-center justify-between gap-2"
82+
class="container min-h-14 flex items-center gap-2"
83+
:class="isOnHomePage ? 'justify-end' : 'justify-between'"
8284
>
8385
<!-- Mobile: Logo + search button (expands search, doesn't navigate) -->
8486
<button
85-
v-if="!isSearchExpanded"
87+
v-if="!isSearchExpanded && !isOnHomePage"
8688
type="button"
8789
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"
8890
:aria-label="$t('nav.tap_to_search')"

0 commit comments

Comments
 (0)