Closed scottohara closed 2 years ago
Note: testing drag in Chrome DevTools device emulation mode could be tricky, because normally click + drag is treated as a scrolling gesture
If we just want to replace jQuery UI with another drag & drop library, this one looks pretty good (and has a jQuery version): http://sortablejs.github.io/Sortable/
Unclear though whether it supports mobile or not (so not sure if it too would require jquery-ui-touch-punch
to work).
jQuery UI 1.13.0 was reported to have native touch support; but that was years ago and jQuery UI appears to be a dead project at this point.
As part of the goal to remove jQuery and replace it with platform native equivalents (https://github.com/scottohara/tvmanager/issues/79), we will need to find a suitable replacement for the jQuery UI
Sortable
module currently used to manually drag episodes to rearrange their order.The ideal would be a platform native solution (e.g. HTML5 drag/drop API), however that API currently doesn't support touch events on mobile as far as I'm aware, nor does it work in Chrome DevTools device emulation.
Additionally, there is a lot that goes into designing a good drag/drop UX (see Atlassian's write up on this), so even if the HTML5 API did work with touch events (but will it with Pointer Events?), there's more to it than just setting
draggable="true"
and attachingondrag{start,over,leave,end}
andondrop
event handlers.Things to consider include:
If we do succeed in removing the
Sortable
module, then we can also remove the dependency onjquery-ui-touch-punch
(as that was only necessary to enableSortable
to work with touch events).