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
Fix drag event on the first pixel moved Fix #1928 #1972 #1934
base: develop
Are you sure you want to change the base?
Conversation
I've got the same issue, however after modifying the files with your changes, the problem still persists... :( |
@laurens94 Can you try to directly use this file and tell if you still get problem: https://github.com/lateek35/OwlCarousel2/blob/2c653406be0e0b164011dfd02cf4beb4735a9e1e/dist/owl.carousel.js ? If not there is another way to get rid of this bug by replacing :
by
even it's more like a "hot fix" but it works |
@lateek35 The changes in the commit you mentioned didn't solve the problem for me, though your 'hot fix' did! Thanks! 👍 |
@lateek35 Although it works, I now receive the following error on triggering destroy.owl.carousel:
|
@laurens94 |
@lateek35 That did the trick! I applied the fix on the commit mentioned before, so that was the problem. Thanks a lot! :) |
@lateek35 Thank you! Your hotfix solved half the problem for me, but the bug kept appearing when the stage was scrolled beyond 0. I was able to fix it fully by enhancing the operator in the second condition as well, right after yours:
So now it compares |
I created this pull request in order to resolve #1928 bug.
Currently the drag event is not fired for the first pixel moved, it only set the listener for the next pixel dragged.
It leads to a bug when the user drag for only 1 pixel (it unfortunately happened sometimes when you click fast in the UI) because
this._drag.stage.current
is not updated.So when the
onDragEnd
event is fired the position is set to -1 because it never enter the if statement of theclosest
method. This is becausecoordinate
shouldn't be0
but1
.