From c8c09cc3d78592d4dfe77c8ce6c9bc7287db8e11 Mon Sep 17 00:00:00 2001 From: Viktor Vaczi Date: Mon, 8 Jun 2026 14:32:57 +0200 Subject: [PATCH] fix(site): close mobile menu when a nav item is tapped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CSS-only hamburger (checkbox toggle) only reset on astro:page-load, which fires for real navigations (Blog) but not for same-page anchor links (How it works / Open & yours / Join the waitlist) that scroll without navigating — so the menu stayed open after tapping them. Add a one-time delegated click handler on the nav that unchecks the toggle on any link tap. Items stay identical to desktop; scrolling unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- site/src/components/Header.astro | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/site/src/components/Header.astro b/site/src/components/Header.astro index d4e7c45..1daeab5 100644 --- a/site/src/components/Header.astro +++ b/site/src/components/Header.astro @@ -155,11 +155,23 @@ const isActive = (href: string, external?: boolean) =>