fix(mobile-menu): implement ultra-robust closing logic with global listeners
All checks were successful
Deploy Theme / deploy (push) Successful in 13s

This commit is contained in:
2026-02-19 19:59:46 +01:00
parent 883dc2122d
commit c398905f9b
2 changed files with 24 additions and 18 deletions

View File

@@ -12,7 +12,7 @@
}
}"
:data-theme="theme"
@htmx:after-on-load.window="Alpine.store('mobileMenu').open = false"
@htmx:before-request.window="$store.mobileMenu.close()"
class="hidden">
<head>
<meta charset="utf-8">
@@ -24,20 +24,6 @@
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<script src="https://unpkg.com/htmx.org@2.0.0"></script>
<script>
document.addEventListener('alpine:init', () => {
Alpine.store('mobileMenu', {
open: false,
toggle() {
this.open = !this.open;
},
close() {
this.open = false;
}
})
})
</script>
{{ghost_head}}
</head>
<body class="{{body_class}} font-sans antialiased" hx-boost="true">