alexbrillant / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
1.57k stars 464 forks source link

If I swipe only left after swiping all cards it still allows to trigger swiperRef.swipeLeft()... so it throws a TypeError #296

Open mattproch opened 4 years ago

mattproch commented 4 years ago

If I swipe only left (gesture or manually trigger swipeLeft) after swiping all cards it still does allow me to manually trigger all the swipe methods (swiperRef.swipeLeft()...) and than it throws TypeError: undefined is not an object (evaluating result.id) cause it actually tries to render the card. If I do even just one swipe right it does not. There is probably an error with handling the swipe left method and the number of remaining cards. The thing is that swipe left actually does trigger onSwipedAll but somehow still allows swiping with methods.

My solution for now is to have the onSwipedAll method implemented and disable the buttons after that.

Expected behaviour is to swipe left behave same as swipe right.