-
Notifications
You must be signed in to change notification settings - Fork 786
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
Hold event triggers click/touch event in iOS safari #138
Comments
Because the |
That worked, thank you! |
I'm having the same issue when using hold to start drag. To use |
I think that calling interact(target)
.draggable({ manualstart: true })
.on('hold', function (event) {
var interaction = event.interaction;
if (!interaction.interacting()) {
interaction.start({ name: 'drag' },
event.interactable,
event.currentTarget);
}
})
.on('move', function (event) {
if (event.interaction.interacting()) {
event.preventDefault();
}
});; |
This prevents scroll of the div while dragging which is great, thanks!. Unfortunately it doesn't solve the original problem of the initial click/touch event triggered on |
You could use interact.js' |
Actually, you could also add a interact(target).on('click', function (event) {
event.prevetnDefault();
event.stopImmediatePropagation();
}, /* useCapture */ true); |
It was actually the context menu on tap hold that was causing my problem since drag was interrupted when the
It all works perfectly when combined with the suggested solution for scroll on drag:
Thank you @taye ! |
If manuanStart is `true`, default prevention will happen only while interacting. See #138
I'm using the "hold to start drag" model on touch devices. When I drop an element, a touch/click event is triggered at the x y coord of the start of the hold. I've tried preventDefault() and stopPropagation() from the hold callback, but I can't seem to stop the click.
Any help or workaround would be greatly appreciated.
Thank you
The text was updated successfully, but these errors were encountered: