Does not use passive listeners to improve scrolling performance - JQuery Issues (Lighthouse Report)

2 replies
I am having a problem with a client's website related to the Google Page Speed Insights Report.

The tool if giving me the following diagnostic:

Does not use passive listeners to improve scrolling performance.

Source

...jquery/jquery.min.js?ver=3.5.1:2:41540
Could you help me with this? I have read a lot and I cannot find a reliable answer.

Regards.
#improve #issues #jquery #lighthouse #listeners #passive #performance #report #scrolling
Avatar of Unregistered
  • Profile picture of the author upzilla
    I had the same problem related with jQuery and passive listeners. In my case solution was in this code
    jQuery.event.special.touchstart = {
    setup: function( _, ns, handle ) {
    this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") });
    }
    };
    {{ DiscussionBoard.errors[11671723].message }}
  • Profile picture of the author upzilla
    Another option was

    document.addEventListener('touchstart', onTouchStart, {passive: true});
    You can try to play with it.
    {{ DiscussionBoard.errors[11671724].message }}
Avatar of Unregistered

Trending Topics