From aa192326094cc1fed7f1231856d40726e96cc93f Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Fri, 8 May 2015 16:12:17 -0700 Subject: [PATCH] [ReactNative] Fix case where scenes are not reset on gesture detaching Summary: Sometimes, when quicly backing out of a gesture, the scene isn't fully reset to the middle position and remains offset by a few pixels. This makes sure that never happens. @public Test Plan: Tested on iOS and I can no longer see the scenes stop when backing out of a gesture --- Libraries/CustomComponents/Navigator/Navigator.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index 3bdfe0da3..6d89faf22 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -874,6 +874,8 @@ var Navigator = React.createClass({ var nextProgress = (distance - gestureDetectMovement) / (gesture.fullDistance - gestureDetectMovement); if (nextProgress < 0 && gesture.isDetachable) { + var gesturingToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture); + this._transitionBetween(this.state.presentedIndex, gesturingToIndex, 0); this._detachGesture(); this.spring.setCurrentValue(0); }