-
Notifications
You must be signed in to change notification settings - Fork 464
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
swipeBack #396
Comments
Same happens with me. I implement news swiping feature using react-native-deck-swiper. And I'm calling swipeBack() function inside onSwipedBottom prop like this -> onSwipedBottom={() => swiperRef.current.swipeBack()} But it didn't work properly. By the way it is working properly in Button. I have Implemented the same using button as mentioned in docs, like this --> <Button It swipes back when i click on the button inside the Swiper Here is my Swiper Code: <View style={[styles.container, {backgroundColor: colors.background}]}> When I swipeBack, it brings back the last card I swiped, but the previous card disappears for 0.5 seconds and comes back. Is there a solution to this? I think the swipeBack command is working incorrectly. Can you solve this? By @cnlkkrb Can Anyone here in the community help me solve this issue???? |
Or Is there any other way to programatically sovle the swipeBack issue using smooth transition with showSecondCard={true} ??? |
When I swipeBack, it brings back the last card I swiped, but the previous card disappears for 0.5 seconds and comes back. Is there a solution to this? I think the swipeBack command is working incorrectly. Can you solve this?
const backButton = () => {
const newIndex = (currentIndex - 1 + cards.length) % cards.length;
setCurrentIndex(newIndex);
dotAnimation.setValue(newIndex);
swiperRef.current?.swipeBack();
//swiperRef.current?.jumpToCardIndex(newIndex);
};
return (
<SafeAreaView style={{ flex: 1, backgroundColor: 'white' }}>
<Swiper
ref={swiperRef}
cards={cards}
containerStyle={styles.swiperContainer}
renderCard={(card) => {
return (
);
}}
onSwipedRight={(cardIndex) => {
setCurrentIndex(cardIndex + 1);
dotAnimation.setValue(cardIndex);
if (cardIndex == cards.length - 1) {
nextCard()
}
}}
onSwipedLeft={(cardIndex) => {
setCurrentIndex(cardIndex + 1);
dotAnimation.setValue(cardIndex + 1);
if (cardIndex === cards.length - 1) {
nextCard();
}
}}
cardStyle={{
width: '90%',
height: '100%',
flex: 1
}}
cardIndex={currentIndex}
stackSize={4}
overlayLabels={OverlayLabels}
animateOverlayLabelsOpacity={true}
disableBottomSwipe={true}
disableTopSwipe={true}
infinite={false}
verticalSwipe={false}
stackScale={0}
secondCardZoom={0}
stackSeparation={0}
marginTop={0}
swipeBackCard={true}
>
The text was updated successfully, but these errors were encountered: