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

sliding when using step doesn't adhere to the step value and slides by only 1 slide at a time #122

Closed
NathanGostelow opened this issue Feb 14, 2019 · 3 comments
Assignees

Comments

@NathanGostelow
Copy link

As the title suggests, if you include step and click the buttons to navigate you step through the number of slides equalling the step value. however if you swipe to navigate you navigate by only 1 at a time. not sure if this is an intentional implementation however it would be nice to have it adhere to the step value when navigating.

https://codesandbox.io/s/vqnq33qwny <- example of the issue.. navigate using the buttons navigates 2 at a time but swiping only navigates 1 at a time.

@tim-steele
Copy link
Contributor

@NathanGostelow Interesting. This seems like it should maybe be a prop you need to set. It could default to the number of "step" but that may break people's existing implementations?

@NathanGostelow
Copy link
Author

could have a prop called slideStep, which defaults to 1 which would be additive and not break current implementations of pure-react-carousel?

@littlejustinh
Copy link
Contributor

@NathanGostelow Thanks for the suggestion. I implemented it today using dragStep as a new optional prop on CarouselProvider. This will let you set dragStep={2} and the small drags will navigate 2 at a time the same way the arrows do. The optional prop defaults to 1, so there will not be any changes to existing implementations.

I updated your code sandbox with the change below so you can check it out.

https://codesandbox.io/s/5nkpv2o84

@littlejustinh littlejustinh self-assigned this Mar 6, 2019
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

3 participants