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

Touchstart event listener causing console warning about scroll-blocking #110

Open
methoil opened this issue Apr 26, 2022 · 4 comments
Open

Comments

@methoil
Copy link

methoil commented Apr 26, 2022

I am working on a project that is using this library, and I am seeing this warning in the console for each instance of the Drag component. I don't notice any problems with scrolling on the page but I was wondering if it could be causing some performance issues. I actually see this warning in the demo page as well so is it expected? I don't see any way to mark the event as passive via the component interface.

vue-easy-dnd.esm.js:746 [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. 
Consider marking event handler as 'passive' to make the page more responsive. 
See https://www.chromestatus.com/feature/5745543795965952

image

@Gap6769
Copy link

Gap6769 commented Jan 27, 2023

Hey I have the same issue, any updates on this?

@nicholaszuccarelli
Copy link
Collaborator

I haven't had this warning pop up for me. If possible could one of you guys please add a replication link and browser details?
I'll try take a look at this next week.

@matthew-dean
Copy link

matthew-dean commented Mar 31, 2023

Any event listener that listens to events and does not prevent the event from actually firing (such as scroll listeners) should always be added with { passive: true }. See: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener

@andreclemente
Copy link

this.$el.addEventListener('mousedown', this.onMouseDown, { passive: true }); this.$el.addEventListener('touchstart', this.onMouseDown, { passive: true });

I can confirm that adding { passive: true } fixes this warning.

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

No branches or pull requests

5 participants