TiDraggable icon indicating copy to clipboard operation
TiDraggable copied to clipboard

Request: Support longpress (or other event) to enable drag

Open FokkeZB opened this issue 10 years ago • 6 comments

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);

});

FokkeZB avatar Aug 29 '14 09:08 FokkeZB

+1 for this!

nicka avatar Sep 02 '14 13:09 nicka

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.

animecyc avatar Sep 02 '14 20:09 animecyc

I've asked @mpociot to have a look as well

FokkeZB avatar Sep 03 '14 06:09 FokkeZB

@viezel @benbahrenburg you any idea on how to get this into this module?

FokkeZB avatar Sep 12 '14 11:09 FokkeZB

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 avatar Nov 28 '14 14:11 m1ga

@m1ga that you could do using https://github.com/animecyc/TiDraggable#array---maps, but I'm still hoping for the drag after longpress

FokkeZB avatar Nov 28 '14 14:11 FokkeZB