Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
YohskDista opened this issue Oct 21, 2020 · 3 comments
Open

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

YohskDista opened this issue Oct 21, 2020 · 3 comments
Labels

Comments

@YohskDista
Copy link
Contributor

YohskDista commented Oct 21, 2020

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.

@jizc
Copy link
Contributor

jizc commented Oct 21, 2020

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.

@YohskDista
Copy link
Contributor Author

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
Copy link
Contributor Author

YohskDista commented Jan 11, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants