Vue.draggable: Better to have an option for 'long-press-to-reorder'

Created on 20 Feb 2018  ·  3Comments  ·  Source: SortableJS/Vue.Draggable

Current implementation is great, thanks!
Here is the case: there is a long scrollabe page with many items, these items can be reordered using current draggable magic, it will go into the dragging mode as soon as I touch an item, it is too easy to drag an item when I just want to scroll the page.

If there is an option only-enable-reorder-when-long-press, it would be much better.

Most helpful comment

In case of somebody need this:
Delay option will do the work:
https://www.npmjs.com/package/sortablejs#options

All 3 comments

I have done this by using a workaround: using <component :is=“tagName”>, detect the long tap in external logic, and if there is a long tap, the tagName will be set to "draggable", or it is "div".

In case of somebody need this:
Delay option will do the work:
https://www.npmjs.com/package/sortablejs#options

I found the best way for mobile is to use the delay and delayOnTouchOnly properties.

Set delay to something short like 50 or 80. Simulates the long press really well.

Was this page helpful?
0 / 5 - 0 ratings