mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
[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:
committed by
Christopher Chedeau
parent
709aa5f259
commit
aa19232609
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user