-
Notifications
You must be signed in to change notification settings - Fork 48
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
Using both swipe.right and swipe.left on the same component won't work #5
Comments
Having same problems. |
@Aterr , I solved this using That's not (of course) a fix, but it's working for me, until a fix is released! |
@kino90 Worked for me too! Thanks 👍 |
Thanks for notifying it. I'll find some time to add this new feature, supporting more directions on just one line. Like |
No new release unfortunately since then. Is this library maintained ? |
@conradfr I'm planing to rewrite this repo totally recently. |
Now you can use version 2.0.0, it supports. |
Just installed the 2.0.1 version and having a similar issue. Tested in chrome. If I attach swipe.left and then swipe.right no matter which direction I swipe it only ever fires the second event. In this case swipe.right. I resorted to the previously mentioned work around. |
I tried in two ways. Both
and
works fine. Could you show me your code or run the test in your browser and tell me the result? @LukeCarlThompson |
I have different event firing on swipe.left and swipe.right v-hammer:swipe.left="onSwipeLeft" In my tests onSwipeRight gets called which ever direction is swiped. Is the syntax correct? I noticed you used swiper.left in your comment? |
@LukeCarlThompson Yes you're right. It's a bug. Thanks for your reminding! I have published a new version 2.1.0. Please have a try. |
Thanks for the update! Just tested with version 2.1.1 and getting some slightly different issues. I also tested with pan events. Now if I have these events onSwipeRight fires only on a right swipe, but onSwipeLeft does not fire if i swipe left. If i have these events Then only the onPan event fires never the onPanStart. If I reverse the order to Then only onPanStart event fires and never onPan However if I have Then both events fire at the expected time. It seems that the issue is only when there are multiple events linked to the same gesture. |
Oh I just now see the syntax has changed? Or I had it wrong before? I should be using Multiple pan events are working now with the correct syntax. However I still get the same behaviour when using swipe.left and swipe.right. |
Yes the syntax changed a little since version 2. I suggest you use swipe.left.right now. @LukeCarlThompson |
Ok thanks for that. I have things working now with the pan events. However if I wanted to have different events fire on swipe.left and swipe.right for the same element the problem would still exist. |
I'm experiencing the same as @LukeCarlThompson. 🤔 |
emmm...For now you can have some logic in your function to judge which direction is, so do the performance. @LukeCarlThompson @gerardo-rodriguez |
For anyone who has the same problem, as @bsdfzzzy said, you can use: onSwipe(event){ |
Hello, thanks for this wrapper!
I was trying to set both
v-hammer:swipe.left="onSwipeLeft"
andv-hammer:swipe.right="onSwipeRight"
with 2 different callbacks, but one of the two callbacks isn't working.Is this a bug or there is a better way to do this?
Thanks!
The text was updated successfully, but these errors were encountered: