-
Notifications
You must be signed in to change notification settings - Fork 115
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
touch devices fires sorting twice #46
Comments
I can confirm this issue both on iOS and Android devices. Seems like a critical issue that should be fixed? I hacked it like this: $('.sortable-container th').on('touchstart', function(e){
e.preventDefault();
}); |
Confirming that the problem still exists as of 9/7/2017. @hynekk and @mjau-mjau's solutions solved the issue for me. I am using Chrome on an Android Samsung S7. |
This problem is caused by having both touchstart and click as event triggers. Rather than preventDefault, comment out the code that adds touchstart or the click. What's needed is when a touchstart is detected, click should be removed as an event trigger. Touchstart is more reliable on phones and tablets; and touchstart is faster (on touch) while click is on release. |
The README explains the justification of the fork. Mention the issues for visibility from the original repo: - Merge HubSpot/sortable#54 - Address HubSpot/sortable#46
Tested on iPad. Events are stored in array and looped through when fired. That caused that sorting is fired twice. Changing following worked for me: sortable.js line 15
clickEvents = ['touchstart']; // instead of pushing event to array
The text was updated successfully, but these errors were encountered: