Skip to content
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

Prop to tell Swiper to stay on same card after swipe action #20

Closed
psychosoft opened this issue Sep 5, 2020 · 2 comments
Closed

Prop to tell Swiper to stay on same card after swipe action #20

psychosoft opened this issue Sep 5, 2020 · 2 comments

Comments

@psychosoft
Copy link

It would be great to have a prop for the Swiper to tell it that it shall stay on the same card (no skip forward in the deck) after a certain Swipe action. For example 4 props named, stayOnSameCardAfterSwipeTop, stayOnSameCardAfterSwipeLeft, stayOnSameCardAfterSwipeRight, stayOnSameCardAfterSwipeBottom.

Love your work! Many thanks!!! :)

@webraptor
Copy link
Owner

It’s actually quite easy to do so. If you keep cardindex in sync with the swiper in a prent component or in your app state, by not updating the cardindex prop on swipe and by making sure you pass back to the swiper the old cardindex it will still display the same card.

But in any way, why would you want to achieve that?
Do you want to revert to the same card, as if user’s not allowed to swipe and on release you want to revert to the same card instead of swiping?

@psychosoft
Copy link
Author

psychosoft commented Sep 6, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants