Skip to content

Commit

Permalink
Add possibility to prevent swipe inside onTouchStart() (#544)
Browse files Browse the repository at this point in the history
tested and accepted.
  • Loading branch information
nuragic authored and Jean-Paul van Houten committed Dec 4, 2019
1 parent dac5916 commit 6b81a2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react-swipeable-views/src/SwipeableViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,10 @@ class SwipeableViews extends React.Component {

handleTouchStart = event => {
if (this.props.onTouchStart) {
this.props.onTouchStart(event);
const shouldReturn = this.props.onTouchStart(event);
if (shouldReturn) {
return;
}
}
this.handleSwipeStart(event);
};
Expand Down

0 comments on commit 6b81a2a

Please sign in to comment.