Skip to content

Commit

Permalink
issue#309: Fix swipe direction
Browse files Browse the repository at this point in the history
  • Loading branch information
leandrowd committed Feb 11, 2019
1 parent ae6a6d0 commit 77b6fb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ class Carousel extends Component {
const containerStyles = {};

if (isHorizontal) {
swiperProps.onSwipeLeft = this.onSwipeBackwards;
swiperProps.onSwipeRight = this.onSwipeForward;
swiperProps.onSwipeLeft = this.onSwipeForward;
swiperProps.onSwipeRight = this.onSwipeBackwards;

if (this.props.dynamicHeight) {
const itemHeight = this.getVariableImageHeight(this.state.selectedItem);
Expand All @@ -687,8 +687,8 @@ class Carousel extends Component {
}

} else {
swiperProps.onSwipeUp = this.props.verticalSwipe === 'natural' ? this.onSwipeForward : this.onSwipeBackwards;
swiperProps.onSwipeDown = this.props.verticalSwipe === 'natural' ? this.onSwipeBackwards : this.onSwipeForward;
swiperProps.onSwipeUp = this.props.verticalSwipe === 'natural' ? this.onSwipeBackwards : this.onSwipeForward;
swiperProps.onSwipeDown = this.props.verticalSwipe === 'natural' ? this.onSwipeForward : this.onSwipeBackwards;
swiperProps.style.height = this.state.itemSize;
containerStyles.height = this.state.itemSize;
}
Expand Down

0 comments on commit 77b6fb5

Please sign in to comment.