Skip to content

Commit 5c57b0d

Browse files
littlejustinhmrbinky3000
authored andcommitted
Feature/122 add optional drag step prop (#124)
* added a dragStep prop that mimics the logic of the step prop but only for drag/swipe events * Fixed the tests that I foolishly broke * fixed package-lock, rollup config, and a linting error * updated readme and typings to include drag step * filtered dragStep from CarouselProvider props * Updated all build files
1 parent 1265905 commit 5c57b0d

File tree

16 files changed

+6708
-6220
lines changed

16 files changed

+6708
-6220
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ Any remaining props not consumed by the component are passed directly to the roo
183183
| orientation | string | "horizontal" | No | Possible values are "horizontal" and "vertical". Let's you have a horizontal or vertical carousel. |
184184
| playDirection | ['forward'|'backward' ] | 'forward' | No | The direction for the auto slideshow |
185185
| step | number | 1 | No | The number of slides to move when pressing the <ButtonBack /> and <ButtonNext /> buttons.|
186-
| tag | string | 'div' | No | The HTML element to use for the provider. |
186+
| dragStep | number | 1 | No | The number of slides to move when performing a short touch drag.|
187+
| tag | string | 'div' | No | The HTML element to use for the provider. |`
187188
| **totalSlides** | number | | **Yes** | Always set this to match the total number of <Slide > components in your carousel |
188189
| touchEnabled | boolean | true | No | Set to true to enable touch events |
189190
| dragEnabled | boolean | true | No | Set to true to enable mouse dragging events |
@@ -462,6 +463,7 @@ Here's more pseudocode. I've listed a bunch of properties that exist in the Car
462463
slideSize: state.slideSize,
463464
slideTraySize: state.slideTraySize
464465
step: state.step,
466+
dragStep: state.dragStep,
465467
totalSlides: state.totalSlides,
466468
touchEnabled: state.touchEnabled,
467469
dragEnabled: state.dragEnabled,
@@ -529,6 +531,7 @@ interface CarouselState {
529531
readonly slideSize: number
530532
readonly slideTraySize: number
531533
readonly step: number
534+
readonly dragStep: number
532535
readonly totalSlides: number
533536
readonly touchEnabled: boolean
534537
readonly dragEnabled: boolean

dist/index.cjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.es.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.es.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-carousel.cjs.css

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-carousel.cjs.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)