SortableJS / Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
https://sortablejs.github.io/Sortable/
MIT License
29.67k stars 3.7k forks source link

Is there an option that supports long press to sort? #379

Closed slmjkdbtl closed 9 years ago

slmjkdbtl commented 9 years ago

There are some event conflick in my app, I want it to start sorting when people long press the element. Is that possible?

RubaXa commented 9 years ago

https://github.com/RubaXa/Sortable/tree/dev#delay-option

MohitTilwani commented 9 years ago

after giving delay it doesnt work

RubaXa commented 9 years ago

@MohitTilwani create example on jsbin.com (draft)

MohitTilwani commented 9 years ago

http://jsbin.com/domuqexani/1/edit?html,js,output

this example posted by you is working on mobile but not on web

diegocasmo commented 9 years ago

Same here. The example works on mobile but it would not work for me on the web. Also, the ghostClass and callbacks onStart, and onEnd options stop working on the web when using delay.

kisonay commented 9 years ago

I'm not able to get this working when using ng-soratable. there just isn't a delay in mobile or desktop, it goes right to sorting.

clauderic commented 9 years ago

While this implementation is functional, it's not implemented properly. If you tap multiple times on an element for the duration of the delay, it triggers sortable, which is undesirable. Might want to look at how hammer.js implements press event recongnition