mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 21:53:30 +00: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:
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user