gong-wpf-dragdrop icon indicating copy to clipboard operation
gong-wpf-dragdrop copied to clipboard

Scroll doesn't work when drag & drop with touch device

Open YohskDista opened this issue 5 years ago • 3 comments

Issue description

The Pull Request #356 allows the user to drag & drop items from a ListView/TreeView/ListBox using a multi-touch screen. The problem is that it doesn't allow anymore to scroll the into the component when there is too many elements because the gesture of the drag & drop is the same as the gesture when we scroll (touch pressed + touch move + touche released).

Suggestions

To fix this issue two propositions have been made in the Pull Request #356:

  • Double tap on an item to select it and allow the user to drag & drop the item. Proposition made by @logiclrd
  • Hold the touch pressed for X ms to allow the user to drag & drop the item. Proposition made by @YohskDista

Double tap

I put here what @logiclrd said in the PR about the "double tap":

This felt more intuitive to me, as I'm not trying to guess what is happening on the screen where I can't see it behind my finger

Hold and drag

My personal opinion is that the "double tap" on an item is not so intuitive on touch screen, I prefer the "hold and drag". More than that, if we have multiple items selected the "double tap" will deselect the items and select only the tapped one. Actually I've never seen a mobile/touch screen application that does the "double tap" to start the drag of an item but I am surely wrong on that point.

If we implement this method we need to have a visual feedback for the user when the item becomes draggable, so when the we old enough the finger on the item.

Conclusion

It's a bug but it is also an open discussion where we can see the different kind of opinion and choose the better solution to implement.

YohskDista avatar Oct 21 '20 13:10 YohskDista

I feel that hold and drag would be most intuitive.

In regards to visual feedback, as long as you use a drag adorner, the user should clearly see when the drag has started.

jizc avatar Oct 21 '20 13:10 jizc

I tried to implement the "hold and drag" but there is some problems during the action. I think that the WPF Framework is totally confused because the "hold" is also used to open the contextual menu and an explicit action is triggered by the Framework. Also, the "DoDragDrop" should block the execution while we are dragging the element, this is correctly done when we use the mouse but, with the touch event, we go through the event and the drag action is stopped immediately.

I would be happy if someone could also check / help me for this development.

YohskDista avatar Jan 08 '21 13:01 YohskDista

I have created a branch where I try to fix this issue : 360-ImproveTouchDragDrop. Currently there is a timer (200ms) that will delay the drag action on touch press, we will be able to start the drag after this delay if we didn't move too much with the finger (otherwise it is a scroll action). Your help is welcome if you have some suggestions or code to propose.

EDIT : an issue has been opened on the WPF repository because of the "DoDragDrop" that doesn't work well with touch events. #3692

YohskDista avatar Jan 11 '21 09:01 YohskDista