-
Notifications
You must be signed in to change notification settings - Fork 460
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
Reset to first card when modal is presented #46
Comments
@acesetmatch I think 1.3.3 fixed it. closing the issue. |
This problem is still there with version 1.4.2. I've created a modal which appears when tapping on the card and when opening the modal, the card stack resets to the first card. onTapCard = (cardIndex) => {
this.setState({currentCardIndex: cardIndex});
this.setDetailsVisible(true);
}; <Swiper
ref={swiper => {
this.swiper = swiper;
}}
cards={this.state.cards}
renderCard={this.renderCard}
onTapCard={this.onTapCard}
cardIndex={this.state.cardIndex}
horizontalSwipe={this.state.horizontalSwipe}
verticalSwipe={this.state.verticalSwipe}
showSecondCard={this.state.showNextCard}
goBackToPreviousCardOnSwipeBottom={this.state.verticalSwipeBack}
goBackToPreviousCardOnSwipeRight={this.state.horizontalSwipeBack}
infinite={this.state.infiniteSwiping}
backgroundColor={Colors.transparent}
cardStyle={styles.cardSwiper}
cardVerticalMargin={10}>
</Swiper>
<Modal
animationType="slide"
transparent={false}
visible={this.state.detailsVisible}
onRequestClose={() => {
this.setDetailsVisible(false);
this.setState({cardIndex: this.state.currentCardIndex}); // workaround with warning
}}
> In the moment I need so set the cardIndex manually to the current index, but then there is a warning.
An other problem with this workaround is that the next visible card is now the second card and not the next one.
|
I have the same problem, when open modal, cards resets to the first card @DFelten you can work around this issue? |
I guess this issue should be reopened. |
yeah I am getting the following error and it resets the card to first index:
|
Has anyone found a solution or effective workaround for this? This component works much better than other swipers, but things like this are almost a deal breaker. |
please reopen |
When setting |
I have a modal that presents whenever the user swipes Right. The view is presented by setting a isModalVisible state variable. However, when I dismiss the modal view, the card stack resets to the first card. Why does this occur and how do I fix this?
Here is my code:
The text was updated successfully, but these errors were encountered: