Plugin does not work well in hybrid scenarios (mouse + touchscreen) #21

Closed
JosePedroDias opened this Issue May 28, 2013 · 2 comments

Comments

Projects
None yet
2 participants

The plugin is assuming either mouse our touch events handling here.
This is problematic in the case of computers having touchscreen (either external or built-in).

Instead of opting one or the other, touch events should be subscribed additionally to the mouse events if they're supported.

In the end it was easy to fix. Since jQuery supports a space separated list of events on its bind method, just add the mouse events to the related touch events scenario. Diff follows:

127,129c127,129
<       start: "touchstart.sortable",
<       end: "touchend.sortable touchcancel.sortable",
<       move: "touchmove.sortable"
---
>       start: "touchstart.sortable mousedown.sortable",
>       end: "touchend.sortable touchcancel.sortable mouseup.sortable",
>       move: "touchmove.sortable mousemove.sortable"
Owner

johnny commented Jun 7, 2013

First of all, sorry for responding so late.

I knew this would creep up one day, as I wrote this. Your fix works since 0.9.10 and I thank you for pointing this out again. The distinction is superfluous since 0.9.10 and I will fix this in master.

@johnny johnny added a commit that referenced this issue Jun 12, 2013

@johnny johnny fix hybrid scenarios (touch + mouse)
see #21
c386d87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment