React-native-deck-swiper: swiper.swipeBack() method broken in 1.2.0

Created on 28 Jun 2017  路  13Comments  路  Source: alexbrillant/react-native-deck-swiper

Adding swipe labels broke swipe back feature

bug help wanted

Most helpful comment

@alexbrillant @webraptor any update on swipe back animation. Would love to have it because excluding the back animation this library is perfect.

All 13 comments

is it fixed?

@vishalTechnoFreek no

Does this occur because swipeDirectionCallback is not a function ?

any updates on this issue?

It is working fine for me. Perhaps you should give more details into what your error is.

in my case it goes to previous card without animation. it also takes about two seconds to see the previous card.

for now, I ended up using jumpToCardIndex() to go to the previous card.

There's no swipeBack animation. If you check the readme, it is in the todo list: Swipe back to the previous card with a custom animation

@alexbrillant @webraptor any update on swipe back animation. Would love to have it because excluding the back animation this library is perfect.

@alexbrillant Was it closed because it's fixed ? 馃

@xavier-villelegier yes, fixed a while ago... Still no animation though... But calling swipeBack puts the last swiped card back on top of the deck.

@webraptor Mmh swipeBack still doesn't work for me though, here is a snack repro.

image

Did I miss something ?

I think you're missing the swipeBack callback function ... https://snack.expo.io/H1t_QvBJQ

Just opened the swiper code and looks like there's no verification if a callback method exists or not, it just calls the method

onSwipedCallbacks = (swipeDirectionCallback, swipedAllCards) => {
    const previousCardIndex = this.state.firstCardIndex
    this.props.onSwiped(previousCardIndex)

    error here ---- >>> swipeDirectionCallback(previousCardIndex)
    if (swipedAllCards) {
      this.props.onSwipedAll()
    }
  }

You can either put an empty callback like in the snack above, or wait for the issue to be fixed in a later PR.

PS: @xavier-villelegier it be great if you could create a new issue with your repro above. thanks.

@webraptor That worked, my bad I just misunderstood the docs on this function. Thanks a lot 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

QQizi picture QQizi  路  4Comments

acesetmatch picture acesetmatch  路  8Comments

deadcoder0904 picture deadcoder0904  路  6Comments

KhalilKhalaf picture KhalilKhalaf  路  3Comments

chaboc picture chaboc  路  5Comments