fix(mobile-menu): add screen width guard to openMenu to prevent accidental triggers
All checks were successful
Deploy Theme / deploy (push) Successful in 13s
All checks were successful
Deploy Theme / deploy (push) Successful in 13s
This commit is contained in:
11
default.hbs
11
default.hbs
@@ -29,8 +29,15 @@
|
|||||||
document.addEventListener('alpine:init', () => {
|
document.addEventListener('alpine:init', () => {
|
||||||
Alpine.store('mobileMenu', {
|
Alpine.store('mobileMenu', {
|
||||||
open: false,
|
open: false,
|
||||||
close() { this.open = false; },
|
close() {
|
||||||
openMenu() { this.open = true; }
|
this.open = false;
|
||||||
|
},
|
||||||
|
openMenu() {
|
||||||
|
// Only open if we are on a mobile screen to prevent unexpected triggers
|
||||||
|
if (window.innerWidth < 768) {
|
||||||
|
this.open = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user