Score:2

How do I safely mark the listener as passive and keep it working?

gb flag

I'm trying to optimize the website performance according to the Google PageSpeed recommendations. One of the advices is to set touch and wheel event listeners as passive, which is shown for the core/assets/vendor/jquery/jquery.min.js file and its a.addEventListener(n,g) line.

When I add {passive: true} to the line a.addEventListener(n,g,{passive: true}), some elements on the website using jQuery stop to work.

How do I safely mark the listener as passive and keep it working?

I am using Drupal 8.7.3.

Jaypan avatar
de flag
This would to be a jQuery question more than a Drupal question.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.