- This topic has 21 replies, 4 voices, and was last updated 8 months, 1 week ago by
David.
-
AuthorPosts
-
August 10, 2020 at 11:01 am #1395927
Leo
StaffCustomer SupportI’ve cleared my browser cache and tried incognito mode but still seeing LiteSpeed Cache in the source code – the as Tom is seeing here:
https://generatepress.com/forums/topic/clicking-the-arrow-on-menu-parent-on-mobile-chrome-does-not-work/#post-1395873Any chance you can check with your hosting support to see if there are any sort of server level cache that’s holding on to this?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 10, 2020 at 11:52 am #1396002Sebastien
Thanks for getting back to me Leo, I’ll check with them.
August 11, 2020 at 5:24 am #1396933Sebastien
Hi guys,
So I contacted my hosting support team and they confirmed they can load the URLs from this subdomain without hitting a cache. Could you please try again and let me know?
Many thanks
SebastienAugust 11, 2020 at 5:40 am #1396953Sebastien
Last update: I found what is causing the issue. I started disabling all the GP modules to see if it would make a difference with the hovering functionality. And when I disabled the Elements module, the menu hovering started working again. After further investigation, it is because of one element JS code I implemented to use passive listeners and improve scrolling performance (as per Google PageSpeed recommendations). And I basically used the code linked from this thread:
https://generatepress.com/forums/topic/passive-listeners-to-improve-scrolling-performance/
The code being:
<script type="text/javascript"> (function() { var supportsPassive = eventListenerOptionsSupported(); if (supportsPassive) { var addEvent = EventTarget.prototype.addEventListener; overwriteAddEvent(addEvent); } function overwriteAddEvent(superMethod) { var defaultOptions = { passive: true, capture: false }; EventTarget.prototype.addEventListener = function(type, listener, options) { var usesListenerOptions = typeof options === 'object'; var useCapture = usesListenerOptions ? options.capture : options; options = usesListenerOptions ? options : {}; options.passive = options.passive !== undefined ? options.passive : defaultOptions.passive; options.capture = useCapture !== undefined ? useCapture : defaultOptions.capture; superMethod.call(this, type, listener, options); }; } function eventListenerOptionsSupported() { var supported = false; try { var opts = Object.defineProperty({}, 'passive', { get: function() { supported = true; } }); window.addEventListener("test", null, opts); } catch (e) {} return supported; } })(); </script>
If you have any suggestions to make this code compatible with the hovering functionality on mobile, I would really appreciate it.
Many thanks
SebastienAugust 11, 2020 at 7:12 am #1397085David
StaffCustomer SupportHi there,
so the passive listeners warning is related to the WP core bug regarding the comments link. Which is something they have yet to resolve. And although the code that user provided works to remove that error we don’t have a solution that stops it from breaking other elements.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 11, 2020 at 7:39 am #1397128Sebastien
Hi David, thanks for this. I’ve disabled the code for now.
August 11, 2020 at 7:49 am #1397230David
StaffCustomer SupportSorry we couldn’t be of more assistance.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.