NO BUG: Nav nestable toggles make menu jump to the left

Browser: Any
OS: macOS

The addition of toggles in the nav nestable menu is making the menu jump to the left when displayed.
Take a look at this page: https://staging.ottervalechurches.org/ministry/ovmc-services/. Keep refreshing the browser and you will see the top menu (fully styled) and the second menu jump (only white text styling) to the left. The third menu which is a clone of the second but without the toggles does not move.

Hi Simon,
Thanks so much for your report!

I’m not sure what you mean by “jump” - nothing jumps for me :thinking:
Would you be so kind as to provide a screencast using https://jam.dev showing and explaining what’s happening?

Best regards,
timmse

Hi Stefan,

Here’s the link to a video. The issue is that the video didn’t capture every time it happened (and it happened each time I pressed page reload), so initially it looks like the menus aren’t moving but if you keep watching you will see them move.

https://jam.dev/c/875312e9-bab2-4355-9f11-959697a6cb2a

The best thing is for you to use safari and go to the page above and keep pressing the page reload button and you’ll see the movement.

Simon

Hey Simon,
Thanks for the video! Now I can see the problem and reproduce it now and then on your site. However, I fail to be able to reproduce it in my installation.

Anyway, the problem probably arises, as you said, from the mobile close toggle being set to display: none via JS. This may take a millisecond too long (possibly by caching or other JS “optimizations”).

Please test the following manual solution, and see if that makes a difference:

Wrap the mobile close toggle with a div, set the HTML tag to “li” and the display value to „none". On the mobile breakpoint, change the display value to “block”.

In the best case, the styles are loaded faster than the JS is applied.

Hey Stefan,

Many thanks this worked a treat.

Simon

Wonderful! Since I could not reproduce the problem in my installation, I will mark the thread as “no bug” for now. If we get more reports about it, we can see if we can find a solution :+1: