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

Check if event is cancelable before calling preventDefault #357

Merged
merged 1 commit into from
Sep 6, 2019

Conversation

crenshaw-dev
Copy link
Contributor

This uses MDN's recommendation to avoid preventDefault when it shouldn't be used:
https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable

Sorry for the messy diff. I think Docker made the whitespace changes? Let me know if you'd like me to clean it up and submit another PR.

@crenshaw-dev
Copy link
Contributor Author

Just discovered this doesn't completely clean up the console. But I think it's a step in the right direction.

@FlorianKoerner
Copy link

Clean Diff: https://github.com/ganlanyuan/tiny-slider/pull/357/files?utf8=%E2%9C%93&diff=split&w=1

@eric-blue
Copy link

@Eduruiz
Copy link

Eduruiz commented Mar 12, 2019

This solves the issue for me.

@FredericBriolet
Copy link

FredericBriolet commented Mar 19, 2019

Adding preventScrollOnTouch: 'auto' to the slider's constructor removed reccurent preventDefault errors for me.

However a new wild one appears sometimes :
tiny-slider.js:2558 [Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.

So yes, check if event is cancellable in OnPanMove would be great 👍

@SuperSchek
Copy link

+1. Could really use this fix.

@crenshaw-dev
Copy link
Contributor Author

I'm not sure how to resolve this. Since these are built files, should I just choose my version? Super difficult to read the diff.

@drjgray
Copy link

drjgray commented May 13, 2019

Any update on this issue?

@artilishes
Copy link

Any news on this issue?

@demyan1411
Copy link

?

@savchukm
Copy link

savchukm commented Jun 23, 2019

@mac9416 Could you please clean up code changes? I hope it gets merged soon.

@panec
Copy link

panec commented Jul 22, 2019

Updated PR: #437

@ganlanyuan ganlanyuan merged commit 527c374 into ganlanyuan:master Sep 6, 2019
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 this pull request may close these issues.