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', () => {
|
||||
Alpine.store('mobileMenu', {
|
||||
open: false,
|
||||
close() { this.open = false; },
|
||||
openMenu() { this.open = true; }
|
||||
close() {
|
||||
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