TiDraggable
TiDraggable copied to clipboard
Request: Support longpress (or other event) to enable drag
I'd like to be able to have the same behaviour as in iOS's calendar, which is enable dragging after a long press
and then have the view glued to the user's finger right away instead of needing to end the touch and then touch and hold again to drag. Understand what I mean?
My most ideal scenario would be to even wait creating the view to be dragged until the longpress
:
someView.addEventListener('longpress', function(e) {
var draggableView = Draggable.createView({
draggableConfig: {
handOver: e // telling the view to "hand over" the existing touch event (incl location)
}
});
});
An alternative could be to enable after the event:
draggableView.addEventListener('longpress', function(e) {
// enabling drag and "handing over" the existing touch event (incl location)
draggableView.draggable.setConfig('handover', e);
});
+1 for this!
I don't think that this would be too difficult to implement. I don't have time at the moment to do it though. As soon as I get time this will be at the top of the list.
I've asked @mpociot to have a look as well
@viezel @benbahrenburg you any idea on how to get this into this module?
any news here? Or is it possible to have a handle on the right side that will move the whole view when dragging the handle? But a longpress to enable would be awesome!
@m1ga that you could do using https://github.com/animecyc/TiDraggable#array---maps, but I'm still hoping for the drag after longpress