Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ type CarouselProps = {
// to determine the index use the velocity of the gesture.
useVelocityForIndex?: boolean,

// if gesture is released and the carousel is scrolling to the slide. Do we need to animate to the slide (true) or snap to the right slide (false)
gestureReleaseAnimated?: boolean,

// render item method, similar to FlatList with some enhancements
renderItem: CarouselRenderProps =>
| Array<React$Element<*> | boolean>
Expand Down
3 changes: 2 additions & 1 deletion src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class SideSwipe extends Component<CarouselProps, State> {
shouldRelease: () => false,
threshold: 0,
useVelocityForIndex: true,
gestureReleaseAnimated: true,
useNativeDriver: true,
};

Expand Down Expand Up @@ -212,7 +213,7 @@ export default class SideSwipe extends Component<CarouselProps, State> {

this.list.scrollToIndex({
index: newIndex,
animated: true,
animated: this.props.gestureReleaseAnimated,
viewOffset: this.props.contentOffset,
});

Expand Down