Skip to content

Commit

Permalink
Fixes unintended side effects caused by facebook#14684
Browse files Browse the repository at this point in the history
I had fixed this locally but not updated the original pull request, sorry. This commit is working for us in production.
  • Loading branch information
lprhodes authored Jul 8, 2017
1 parent bf1b67e commit 7786a55
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Libraries/Experimental/SwipeableRow/SwipeableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ const SwipeableRow = createReactClass({
propTypes: {
children: PropTypes.any,
isOpen: PropTypes.bool,
preventSwipeLeft: PropTypes.bool,
preventSwipeRight: PropTypes.bool,
maxSwipeDistance: PropTypes.number.isRequired,
onOpen: PropTypes.func.isRequired,
Expand Down Expand Up @@ -110,7 +109,6 @@ const SwipeableRow = createReactClass({
getDefaultProps(): Object {
return {
isOpen: false,
preventSwipeLeft: false,
preventSwipeRight: false,
maxSwipeDistance: 0,
onOpen: emptyFunction,
Expand Down Expand Up @@ -339,12 +337,8 @@ const SwipeableRow = createReactClass({

// Ignore swipes due to user's finger moving slightly when tapping
_isValidSwipe(gestureState: Object): boolean {
if (this.props.preventSwipeLeft && gestureState.dx < 0) {
return false;
}
if (this.props.preventSwipeRight && gestureState.dx > 0) {
return false;
}
if (this.props.preventSwipeRight && this._previousLeft === CLOSED_LEFT_POSITION && gestureState.dx > 0) return false

return Math.abs(gestureState.dx) > HORIZONTAL_SWIPE_DISTANCE_THRESHOLD;
},

Expand Down

0 comments on commit 7786a55

Please sign in to comment.