[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
This commit is contained in:
Eric Vicenti 2015-05-08 16:12:17 -07:00 committed by Christopher Chedeau
parent 709aa5f259
commit aa19232609

View File

@ -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);
}