-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
onclick and draggable conflict #306
Comments
update: i resolved this issue by giving 'cancel' parameter on draggable function to element with id card title. |
Can you provide an example please? |
$( ".dragable" ).draggable({ |
The issue is caused by some browsers triggering 2 or multiple move events immediately after touch start and that triggers ._touchMoved = true, that stops execution on click event in touch end. One logical workaround is to enhance the trip logic and instead of the true false this._touchMoved, set a timer that trips for short touch events, see fix that worked for me AMEND in the mouseProto._touchStart:
DELETE in the mouseProto._touchMove: AMEND in the mouseProto._touchEnd: |
one other solution (hack of a hack) is to check distance traveled on mouse move and trigger click if 0...but that might be trickier and costly to pull... |
My fork has implemented a similar solution - it assumes that you mean a click if you hold your finger down for less than 500ms, or if you move your finger less than 10px in any direction |
Hello,
I have some issues when trying to click my element which is 'a href' and the parent is a div with draggable class.
The code is 100% fine on computer's browser however when i use touch punch for mobile.
The div which has draggable class is triggered first, before the onclick happened.
Onclick is only occuring, if the user need to be patient about how they click on the element. It is like 1 out of 10 click.
I've tried adding a delay parameter with jQuery UI on draggable function, the onclick function is not triggered while the function is always waiting for draggable triggered.
How do i resolve this issue?
This is my HTML code
This is my JS code
The text was updated successfully, but these errors were encountered: