Keep dropdown menus open until second click?


I’m building a sidebar navigation for a brand guidelines page, and I want sub-menus to expand when you click each link, and remain open – ideally, being able to have all sub-menus open simultaneously if you wanted.

I had built this nicely without using the dropdown module, and instead using interactions triggered on first and second click to show and hide the sub-menu, no problem. However, I discovered on the mobile menu, each time you clicked a parent link it would close the whole nav menu. You would then have to reopen the nav menu to see the sub-menu. I then tried disabling the interaction on mobile breakpoints (and just have all of the sub-menus always open) but clicking the parent link still closes the whole navbar even if there is no interaction, link, or #.

So I have resorted to using the drop down menu module, which functions nicely on mobile, but I cannot see how to get each dropdown to persistently stay open until a second click to close it.

I assume I need custom code of some sort, unless there’s something I’m not seeing?

Unfortunately I cannot share a read-only link to the site yet, but have included some screenshots. The screenshot of the navigator shows link 1. built with the dropdown module, and the remaining links built just with interactions.

Many thanks for any help!


Yeah it’s a challenge if we can’t see the read only link. But it shouldn’t need custom code.