getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

[typhoon] Mobile Nav Modular OnPageMenu hide onClick item #321

Closed migrand closed 1 year ago

migrand commented 1 year ago

I successfully changed the mobile nav to the modular onPage menu but I can't make the menu disappear after clicking on an item. I tried to add @click="show_mobile_nav = false to the items, but always get the error message that "show_mobile_nav" is not defined. Any help is very much appreciated.

Thanks

rhukster commented 1 year ago

the x-data entry for show_mobile_nav is on the <html> tag so it's pretty global, i'm not sure why you are not able to change the state.

If you look at the templates/partials/header.html.twig file line 80, you will see:

<button @click="show_mobile_nav = true" aria-label="Mobile menu" type="button"

If you have the same kind of syntax as this there's no reason why it should give that error.