Skip to content

Can you support touch events for dragging and dropping ? #6

@shaydoc

Description

@shaydoc

Hey, can the draggable tree support touch for drag and drop?

Activity

phphe

phphe commented on Jun 8, 2018

@phphe
Owner

ok, i will try that today

shaydoc

shaydoc commented on Jun 8, 2018

@shaydoc
Author

great thanks, it should be a matter of adding the touch event listeners to your draggablehelper ?

phphe

phphe commented on Jun 11, 2018

@phphe
Owner

@shaydoc yes. i tried, branch dev-mobile: https://github.com/phphe/vue-draggable-nested-tree/tree/dev-mobile. There is an issue, the page will move when drag

shaydoc

shaydoc commented on Jun 12, 2018

@shaydoc
Author

@phphe did you have any joy looking at making the control touch enabled ?

phphe

phphe commented on Jun 13, 2018

@phphe
Owner

@shaydoc yes. So I created the branch dev-mobile. There are some bugs.

shaydoc

shaydoc commented on Jun 14, 2018

@shaydoc
Author

Cool

shaydoc

shaydoc commented on Jun 14, 2018

@shaydoc
Author

I did some touch stuff yesterday, jquery.nestable handles it well

https://github.com/RamonSmit/Nestable2/blob/master/jquery.nestable.js

phphe

phphe commented on Jul 29, 2018

@phphe
Owner

@shaydoc I merged mobile in latest version. There is an issue: page scrolling on drag. I don't have any idea now.

shaydoc

shaydoc commented on Aug 6, 2018

@shaydoc
Author

@phphe
I found that using mouse/touch position solves this rather nicely, any thoughts?

`function resolveDragedElAndInitialPosition(e) {
var el0 = opt.getEl ? opt.getEl(dragHandlerEl, opt) : dragHandlerEl;
var el = el0;

if (opt.clone) {
store.triggerEl = el0;
el = el0.cloneNode(true);
el0.parentElement.appendChild(el);
}

var pos = offsetToPosition(el, getOffset(el0));
pos.y = e.pageY;
return {
position: pos,
el: el
};
}`

phphe

phphe commented on Aug 10, 2018

@phphe
Owner

@shaydoc try latest 2.1.3

ram33

ram33 commented on May 7, 2019

@ram33

@phphe There is still an issue on mobile when page has scroll. Not always. But drag is happening only when we carefully drag the item. I am using version 2.2.17. Any workarounds?

Thank you for this nice library btw.

ram33

ram33 commented on May 8, 2019

@ram33

@phphe Seem to work fine, if we do preventDefault on item/handle's touchstart & touchmove events. I have currently done it on item slot which works for me. But I can raise a pull-request by adding those in code. Please let me know.

phphe

phphe commented on May 9, 2019

@phphe
Owner

@ram33 awesome. please raise it, i will check that.

ram33

ram33 commented on May 11, 2019

@ram33

@phphe please check #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @shaydoc@ram33@phphe

        Issue actions

          Can you support touch events for dragging and dropping ? · Issue #6 · phphe/vue-draggable-nested-tree