Home Forums WoodMart support forum Mobile menu toggle does not work because class ‘wd-active’ is missing

Mobile menu toggle does not work because class ‘wd-active’ is missing

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #531573

    webreturn
    Participant

    Dear developers of WoodMart,

    The mobile menu doesn’t seem to work, because JavaScript can’t find ul.wd-active. This error appears:

    mobileNavigation.min.js?ver=7.4.3:1 Uncaught TypeError: Cannot read properties of null (reading 'length')
        at woodmartThemeModule.mobileNavigation (mobileNavigation.min.js?ver=7.4.3:1:608)
        at mobileNavigation.min.js?ver=7.4.3:1:5907

    Taking a look at PHP file /woodmart/inc/template-tags/template-tags.php I can see that the class wd-active is removed from variable $pages_active and appended to variable $categories_active if setting <b>Swap menus</b> is toggled on in the header builder.

    This setting can only be toggled on/off when option <b>Show categories menu</b> is enabled.
    However, if you toggle option <b>Swap menus</b> on and toggle option <b>Show categories menu</b> off, that this settings stays enabled.

    This causes a problem, because the PHP-file does not take into account whether or not option <b>Show categories menu</b> is toggled on.

    <b>Solution:</b>
    Add a check in the PHP-file to only move class wd-active to the categories menu if the categories menu is enabled, because otherwise class wd-active is taken away from the only menu that is left.

    To fix this we disabled option <b>Swap menus</b> and then disabled option <b>Show categories menu</b>.

    Kind regards,
    Thijs Terluin
    Webreturn

    #531632

    Artem Temos
    Keymaster

    Hello,

    Thank you for your report. We will review this and fix it in our next theme update.

    Kind Regards

    #534754

    RichardTRC
    Participant

    Hi Artem. This is quite a major issue, do you think we could get a patch or update asap please?

    By the way; I applied patch “533790 – FIXED: Mobile menu issue.” because I thought it was for this issue. How do I undo that patch?

    #534867

    Artem Temos
    Keymaster

    Hello,

    Could you please clarify why this issue is critical for you? What problem do you have on your website now?

    Kind Regards

    #534982

    RichardTRC
    Participant

    Hi Artem.

    Currently “Show categories menu” has to be enabled for the mobile header menu otherwise the entire menu doesn’t open on mobile. Any site using woodmart which had Show categories menu disabled will not be able to open their mobile menu.

    #534984

    Artem Temos
    Keymaster

    Please, send us your admin access so we can check this issue on your website.

    #534998

    RichardTRC
    Participant

    The site in question is being developed locally so I can’t share access.

    I just went to go and gather some screenshots for you and very strangely the issue isn’t occurring anymore! I spent all day yesterday trying to diagnose it and it’s now disappeared and the mobile menu is working fine! Sorry to waste your time. Thanks for your speedy responses Artem, have a great day.

    #535063

    Artem Temos
    Keymaster

    No problem. Let me know if the issue appears again for some reason.

    Kind Regards

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Mobile menu toggle does not work because class ‘wd-active’ is missing’ is closed to new replies.