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

touch devices fires sorting twice #46

Open
hynekk opened this issue Aug 4, 2016 · 3 comments
Open

touch devices fires sorting twice #46

hynekk opened this issue Aug 4, 2016 · 3 comments

Comments

@hynekk
Copy link

hynekk commented Aug 4, 2016

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

@mjau-mjau
Copy link

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();
});

@annetters
Copy link

annetters commented Sep 7, 2017

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.

@X25guru
Copy link

X25guru commented May 19, 2019

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.

ztaira pushed a commit to ztaira/sortable that referenced this issue Dec 29, 2020
devoxel added a commit to devoxel/sortof-sortable that referenced this issue Oct 23, 2024
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
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

4 participants