fix(navigation): move mobile menu inside viewport and remove hx-preserve to fix active route highlighting
All checks were successful
Deploy Theme / deploy (push) Successful in 14s

This commit is contained in:
2026-02-20 11:21:09 +01:00
parent 881b357167
commit 0d05bb254d
2 changed files with 2 additions and 4 deletions

View File

@@ -40,13 +40,12 @@
hx-select="#viewport" hx-select="#viewport"
> >
{{!-- The Mobile Menu is outside the swap target and stays alive --}}
{{> mobile-menu}}
{{!-- {{!--
This container is the target for HTMX swaps. This container is the target for HTMX swaps.
Moving everything inside ensures navigation highlights and states update on every click.
--}} --}}
<div id="viewport" class="min-h-screen flex flex-col"> <div id="viewport" class="min-h-screen flex flex-col">
{{> mobile-menu}}
{{> header}} {{> header}}
<main class="flex-grow"> <main class="flex-grow">

View File

@@ -1,5 +1,4 @@
<div id="mobile-menu" <div id="mobile-menu"
hx-preserve
x-show="mobileMenuOpen" x-show="mobileMenuOpen"
x-transition:enter="transition ease-out duration-300" x-transition:enter="transition ease-out duration-300"
x-transition:enter-start="-translate-x-full" x-transition:enter-start="-translate-x-full"