Mobile menu does not work but desktop menu does.

Mobile menu does not work but desktop menu does.

suety
Visitor
1 0 0

Not sure why this is happening but desktop menu works and mobile menu doesn't.   The site is https://shopjemmasbeautybar.com/

Reply 1 (1)

beauxbreaux
Shopify Partner
294 25 59

Hello,

(clicking, touch, hover <--  event listeners are just code that listens for the user to do these actions)

The error code is related to event listeners (specifically on Chrome) being set to passive and also calling the method 'preventDefault' which is usually used to prevent the page from reloading . Now this may just sound like Latin but essentially Google made an update and in that update event listeners can not be both passive and set to prevent default. I downloaded a fresh install of your theme just to see if it would prompt this error and it does not. But this is the hard part when buying/using a theme that is not properly maintained. It will work for awhile and then you add one thing and it breaks the site. So I imagine you made some sort of change (something completely normal) and it is triggering this error). 

I can not reproduce the error to try and test out the code. What you can do is create a copy of your site and test out these changes on the copy. 

Go to edit your code>

Search for the fastclick file

 

Now change these lines:

layer.addEventListener('touchstart', this.onTouchStart, false);
layer.addEventListener('touchmove', this.onTouchMove, false);
layer.addEventListener('touchend', this.onTouchEnd, false);
layer.addEventListener('touchcancel', this.onTouchCancel, false);

 To this: 

layer.addEventListener('touchstart', this.onTouchStart, { passive: false });
layer.addEventListener('touchmove', this.onTouchMove, { passive: false });
layer.addEventListener('touchend', this.onTouchEnd, { passive: false });
layer.addEventListener('touchcancel', this.onTouchCancel, { passive: false });

 

 

I have no idea if this will fix it as there could be something else going on that I can not tell. What I would do is report this error to the theme builder so that they can come up with a patch for it. 

Beaux Barker
Developer
Buy me a Coffee