in the desktop mode the event logs fine but not in the mobile mode. I thought part of the current menu was that this would work for all formfactors.
I tried using hamburgerMenuContent2 with onItemClick…as that is what the hamburger menu seems to be called…but I log an error without even trying to click it:
TypeError: $w(“#hamburgerMenuContent2”).onItemClick is not a function. (In ‘$w(“#hamburgerMenuContent2”).onItemClick((function(e){console.log(e)}))’,
Firstly, with the introduction of the unified menu, the same element ID will apply to the horizontal menu, AND to the hamburger menu button.
If you want to target the menu inside the hamburger menu, you’ll need to edit the menu, and select the inner menu
With the above said, I noticed the inner menu doesn’t currently have the same event handlers (like onItemClick) that the horizontal menu has. I’ve raised this with the team in the meantime
Is there something specific you’re trying to achieve? Perhaps there’s a workaround to it
Thanks for the reply Noah. Surprised nobody else has run into this yet.
What I am trying to do is rebuild the a page without having to re-download a big chunk of data from a collection - I think maybe I could force a page reload but that will cause a several second delay while the big query runs again…plus I am not sure I can actually force a reload, based on past experience (I feel like I found a way once but forget how).
The behaviour I am after is that clicking on the home button, when I’m already on the home page, should just uncollapse a bunch of sections to restore the page to it’s original state. But, if I am NOT already on the home page, I want it to go to the there as normal. So I wanted to handle the onItemClick in Velo.
I could use a separate button to achieve the same thing I guess, detaching Home from the menu and I think it could all be made to align well but really what I am doing SHOULD be possible. Very curious to hear what you get back from the team. Did you give them an example site to show the problem? I could put that together if it will help.