Open leoheck opened 3 years ago
I was able to fix these violations from my side by doing this
// Atempt to fix the:
// [Violation] Added non-passive event listener to a scroll-blocking
jQuery.event.special.touchstart = {
setup: function( _, ns, handle ){
if ( ns.includes("noPreventDefault") ) {
this.addEventListener("touchstart", handle, { passive: false });
} else {
this.addEventListener("touchstart", handle, { passive: true });
}
}
};
jQuery.event.special.touchmove = {
setup: function( _, ns, handle ){
if ( ns.includes("noPreventDefault") ) {
this.addEventListener("touchmove", handle, { passive: false });
} else {
this.addEventListener("touchmove", handle, { passive: true });
}
}
};
jQuery.event.special.mousewheel = {
setup: function( _, ns, handle ){
if ( ns.includes("noPreventDefault") ) {
this.addEventListener("mousewheel", handle, { passive: false });
} else {
this.addEventListener("mousewheel", handle, { passive: true });
}
}
};
What is this violation? How could I fix this?