Skip to content
Advertisement

WordPress and best practice with passive event listeners

So I have run an audit on a website in chrome and google says I should use passive event listeners.

enter image description here

I have looked through the code and identified it’s coming from the wordpress emoji integration:

JavaScript

Now I want to keep emoji support for wordpress but I want to add the passive listeners for better usability, how would I go about this.

I thought about removing it like in this link and adding it manually but I don’t think this is a good idea.

Advertisement

Answer

Cool I came across a solution written by devlucky who provides a small piece of javascript to fix the problem.

Check out this article

This is the javascript that made the listeners passive.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement