react-sortable-hoc icon indicating copy to clipboard operation
react-sortable-hoc copied to clipboard

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive

Open nxneha opened this issue 6 years ago • 4 comments

Hi @clauderic

I am facing a responsive issue while dragging the list element. Any help will be highly appreciable

Plugin version: ^1.8.3

Thanks for the help

nxneha avatar Apr 26 '19 20:04 nxneha

nxneha avatar Apr 26 '19 20:04 nxneha

This duplicates #210, perhaps the issue you are experiencing is not related to the violations logged in Chrome's Dev Tools.

jaapspiering avatar Jul 17 '19 14:07 jaapspiering

This is actually very easy to fix by adjusting this code:

Change

this.container.addEventListener(eventName, this.events[key], false)

to

this.container.addEventListener(eventName, this.events[key], { passive: false })

Same for all the other places where addEventListener is just called with false parameter. Changing it to the object argument will tell Chrome that the event handler was intentionally passive and not output the warning any more.

olee avatar Feb 03 '21 02:02 olee

This commit hasn't made it into version 2.0.0, has it? It's still this.container.addEventListener(eventName, this.events[key], false)

Daffeldoff avatar Mar 29 '21 11:03 Daffeldoff