-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
How to trigger drag after a delay - on touch and hold for x ms? #182
Comments
The proposed solution on bevacqua/angularjs-dragula#15: var heldForThreeSeconds = 3000
var itemWasClicked
document.body.addEventListener('mousedown', function () {
itemWasClicked = new Date()
})
dragula({
moves: function () {
return new Date() - itemWasClicked > heldForThreeSeconds
}
} does not work, as the |
Added an API endpoint var drake = dragula(containers, {
moves: function () {
if (lifted) {
lifted = false;
return true;
}
}
});
document.body.addEventListener('mousedown', function (e) {
setTimeout(function () {
lifted = true;
drake.lift(e.target);
}, 3000)
})
|
@kennethlynne please give the PR branch a try and let me know whether it works as you'd expect. |
Awesome, thanks! It is on my todo, I will probably not look into it before next week. We worked our way around the problem, but this will be a nice improvement. |
Use Slack for support requests. See #248. |
I need to be able to disable drag and only enable it when the user holds an item for x ms. What is the best way to achieve this?
The text was updated successfully, but these errors were encountered: