Open Mokto opened 8 years ago
+1 :)
In componentWillMount it is possible to add those extra tests
if (relativeGestureDistance < -0.25 || (relativeGestureDistance < 0 && vx <= -0.25)) {
if (this.state.index < this.props.children.length - 1) { // make sure it is not the last page before incrementing
newIndex += 1;
}
} else if (relativeGestureDistance > 0.25 || (relativeGestureDistance > 0 && vx >= 0.25)) {
if (this.state.index > 0) { // make sure it is not the first page before decrementing
newIndex -= 1;
}
}
Hi,
It would be nice that we could prevent the user to swipe right on the last page and left on the first page.
Thanks.