rochal / jQuery-slimScroll

small jQuery plugin that transforms any div into a scrollable area with a nice scrollbar. Demo and more:
http://rocha.la/jQuery-slimScroll
2.23k stars 928 forks source link

Solution for "[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive." #319

Open Hydra9268 opened 4 years ago

Hydra9268 commented 4 years ago

If anyone has encountered this issue, I've fixed it.

On line 329, replace

if (e.preventDefault && !releaseScroll) { e.preventDefault(); }

with

if (e.preventDefault && !releaseScroll) {  e.target.blur(); }

Remove line 330

if (!releaseScroll) { e.returnValue = false; }

Inside the else on line 350, add

document.onmousemove = function (e) { e.returnValue = false };

That will allow the script to correctly return a false value during the scroll wheel event. Hope that helps! :)

rsimonton commented 4 years ago

@Hydra9268 there's already an open issue for this topic, see here: https://github.com/rochal/jQuery-slimScroll/issues/316