Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nxneha opened this issue Apr 26, 2019 · 4 comments · May be fixed by #770

Comments

@nxneha
Copy link

nxneha commented Apr 26, 2019

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
Copy link
Author

nxneha commented Apr 26, 2019

@jaapspiering
Copy link

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

@olee
Copy link

olee commented Feb 3, 2021

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 added a commit to olee/react-sortable-hoc that referenced this issue Feb 3, 2021
@olee olee linked a pull request Feb 3, 2021 that will close this issue
@Daffeldoff
Copy link

Daffeldoff commented Mar 29, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants