In Luma of Magento2 theres a build in responsive burger-menu included.

We have the problem that once you open the nav, the body class get the classes nav-before-open nav-open, and if you click on it again, those classes are meaned to be removed. But at least nav-open stays where it is, making it hard to work with it.

Is anyone having the same problem? How to solve it?

  • The newest version is 2.1.0. You should update.
    – tecjam
    Jul 25, 2016 at 14:50
  • Thats not really an helpful answer...
    – Max
    Jul 25, 2016 at 14:52
  • It's not an answer, it's a comment. There have been many updates since 2.0.6 in the core as well as Luma. The issue may be fixed in 2.0.7.
    – tecjam
    Jul 25, 2016 at 14:53
  • I just tested it for you. This issue is no longer present in Magento ver. 2.1.0
    – tecjam
    Jul 25, 2016 at 15:01
  • I am using 2.1.6 version and the problem still exists. Any idea?
    – Korbin
    Sep 11, 2017 at 8:01

2 Answers 2


I just tested it with my local Magento ver. 2.1.0 installation with test-data.

The class added to the html tag when the off-canvas menu is slid-in is now successfully removed upon closing the menu.

Updating your system will fix that (and probably many other things).

// edit:

I installed 2.0.6 using composer to check it on my setup - here it also works as expected:


enter image description here

After closing:

enter image description here

Maybe your edits have broken something.

  • Thanks for setting up a local dev. However, we can't update currently on this project, therefore we can't really use that as solution. Have you been able to check if the problem exists on your local dev @ Mage 2.0.6?
    – Max
    Jul 25, 2016 at 15:12
  • @Max: This also works for me in 2.0.6 (sorry it took a while to install). I edited my answer.
    – tecjam
    Jul 25, 2016 at 15:30
  • Thank you very much for your effort! Obviously some of our edits broke this. I will investigate it. Thank you anyway!
    – Max
    Jul 25, 2016 at 19:43

This happens only in developer mode with Varnish Cache enabled. (it works in production mode) It seems to be a bug prior to v2.1

  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review Jan 26, 2017 at 15:31
  • I disagree. It answers the question since this is the default behaviour before v2.1. It does not happen in production mode. So rather you hack it with js or you upgrade.
    – lopezi
    Jan 26, 2017 at 16:02
  • It answers the question "Is anyone having the same problem?", but it's not a solution (if you update the answer with the information that it's a bug, solved in 2.1, then I'd count it as a valid answer) Jan 26, 2017 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.