Skip to content Skip to sidebar Skip to footer

Unable To Preventdefault Inside Passive Event Listener Due To Target Being Treated As Passive? Why This Error Upon Scrolling?

I am using chrome latest version. My application throws error: Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chrome

Solution 1:

I know it's a bit old. But I found a solution for my likely problem.

The problem is; wheel event needs to be passive or not. Modern browsers such as chrome threated as it passive=true. So exception rises.

Find addition of wheel event listener something like "window.addEventListener('wheel', func)" or "window.addEventListener('wheel', func, true|false)" and change it as "window.addEventListener('wheel', func, {passive:false})".

My problem solved like that.

Solution 2:

If your code is minified like it was with a plugin that I've installed in wordpress called advanced-scrollbar/js/jquery.nicescroll.min.js, then you should like FerhatOzkanun stated above look for specifics in the source code and update it accordingly, clear the cache and re-run then inspect once again. For me this solution worked..

You may look for something like this firstly:

/*comment this ->return*/b.preventDefault(); /*add this*/{passive:false}

and look for this instance and replace it.

/*comment this ->e||!1*//*add this*/{passive:false}

which refers to window.addEventListener('wheel', func, true|false) mentioned before.

Post a Comment for "Unable To Preventdefault Inside Passive Event Listener Due To Target Being Treated As Passive? Why This Error Upon Scrolling?"