SnowdogApps / magento2-menu

Provides powerful menu editor to replace category based menus in Magento 2
MIT License
296 stars 105 forks source link

v2.23 breaks mobile nav sidebar #289

Closed FadedOut closed 1 year ago

FadedOut commented 1 year ago

Hello,

I have been struggling to narrow this down but in one of my recent updates my mobile nav sidebar menu stopped working (clicking the three lines causes the menu to not pop-out like it should). I went through my modules and decided to try removing this one - menu worked. I tested on 2.22 and it works. But once I upgrade to 2.23, the mobile nav stops working. I think this is related to this module, not a configuration of my modules.

Pre-requesists: -Magento 2.4.6-p1 -PHP 8.2 -Snowdog 2.23 (and 2.23.1)

Problem: Mobile nav stops working. The mobile nav sidebar does not pop-out

How it should work: When clicking the three lines the mobile nav sidebar should pop-out

Solution: Downgrade back to 2.22. Mobile nav now works again.

adamwaclawczyk commented 1 year ago

I cannot replicate this. Could you give us more info?

  1. Is the menu rendering in browser's Dev Console > HTML Inspector?
  2. Are there any errors in browser's Dev Console > Console?
  3. What frontend are you using?
  4. Is it happening on dev local or prod environment?
JKrupinski commented 1 year ago

Hi @FadedOut Do you use any js for your menu? We added 'menu': 'Snowdog_Menu/js/menu.babel' data-mage-init='{"menu": {}}' recently maybe it cousing the problem for you?

FadedOut commented 1 year ago

Hello @adamwaclawczyk

  1. Is the menu rendering in browser's Dev Console > HTML Inspector?
  2. Are there any errors in browser's Dev Console > Console?
  3. What frontend are you using?
  4. Is it happening on dev local or prod environment?
  1. It's not, all I see is the following: magento-snowdog-menu-affecting-frontpage-mobile-nav-code
<span data-action="toggle-nav" class="action nav-toggle">
::before
<span>Toggle Nav</span>
</span>
  1. There are no errors. Which makes it harder to debug unfortunately.
  2. Using my own theme heavily based on luma. Basically I took luma and added quite a bit of CSS and some blocks. Nothing too crazy.
  3. The environment I'm using this on is basically my live environment, a version I am currently building. I should of also pointed out the mode is "production".

@JKrupinski I don't believe I'm using any JS. Though I do have a slightly modified mobile menu (I've used theme overrides to get blocks added). But maybe this observer file I'm using to add a menu item could be causing it. I'm not super versed in js code but this file might contain some (as I see some $ signs). I will attach:

FadedOut - Mobile Nav Extra Menu Item - File.zip

JKrupinski commented 1 year ago

@FadedOut Could you switch to test/stage branch in vendor/snowdog/module-menu then run bin/magento setup:upgrade in your main repository and check if mobile menu works for you?

FadedOut commented 1 year ago

@JKrupinski thank you for attempting to makes changes to get this to work it's much appreciated.

I tried changing branches but I use goomento which bundles this menu module with it and as such when I attempt to change to the test/stage branch it fails due to goomento requiring only up to 2.23.1 of this module.

So I was going to ask if simply making those file changes that are posted in the commit would be fine, but instead I just decided to just go ahead and try it anyway. Well, that seemed to do the trick 🙂👍. Changing the references from "menu" to "snowdogMenu" seemed to fix it. Not sure if the eslint changes are necessary for this test but it seems to be working now with just the file changes.

So I suppose this ticket can be closed with the changes you made in that commit fixing this issue 👍

Thanks again!