zefoy / ngx-perfect-scrollbar

Angular wrapper library for the Perfect Scrollbar
MIT License
521 stars 116 forks source link

Unable to preventDefault inside passive event listener due to target being treated as passive #284

Open alastairkitchen opened 4 years ago

alastairkitchen commented 4 years ago

i'm getting the following error when i drag the scrollbar when using a device with touch controls

"Unable to preventDefault inside passive event listener due to target being treated as passive"

chrome-error

To get the error I was using google chromes device emulation (emulating an ipad). Dragging the scrollbar within the element is fine however if i use the scrollbar then drag the error appears (i've highlighted this in red in the screen shot)

chrome-frontend

this is the source of the error that is being thrown in devtools

chrome-error-source

I tried to replicate this error using your sandbox but could not get the same error unfortunately

nch3ng commented 4 years ago

I'm having the same issue. too

bri1990 commented 4 years ago

is there a temporary solution for this? It seems to happen only in chrome after a touch event

hanyska commented 4 years ago

same

bogdandynamic commented 3 years ago

same problem here. is there any workaround or a solution?

bogdandynamic commented 3 years ago

found a solution to the problem. if you use npm (using latest version of perfect scrollbar), goto node_modules/perfect-scrollbar/dist and modify

If you work with the source code, goto node_modules/perfect-scrollbar/src/handlers and edit mouse-wheel.js, function function mousewheelHandler(e) (line 149) as follows:

if (shouldPrevent && !e.ctrlKey) {
  e.stopPropagation();
  if (!e.passive)  // ADD THIS
    e.preventDefault();
}

Hope it helps.

cakeinpanic commented 3 years ago

same problem when using with angular and unpatching wheel event with zone-flags Solution from @bogdandynamic seems good