Skip to content

Commit

Permalink
[ReactNative] Navigator clean scenes popped with gesture
Browse files Browse the repository at this point in the history
Summary:
Fixes #1252

Scenes dismissed/popped via a gesture were not being removed. This is probably a regression from an earlier refactor.

Test plan: log statements after scene focusing now reports that `navigator.getCurrentRoutes().length` lowers after gesture. Tested on UIExplorer Navigator example
Closes #1346
Github Author: Eric Vicenti <[email protected]>

@public

Test Plan: Imported from GitHub, without a `Test Plan:` line.
  • Loading branch information
Eric Vicenti committed May 20, 2015
1 parent 11b515b commit 97137e8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Libraries/CustomComponents/Navigator/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,16 @@ var Navigator = React.createClass({
}
} else {
// The gesture has enough velocity to complete, so we transition to the gesture's destination
this._transitionTo(destIndex, transitionVelocity);
this._transitionTo(
destIndex,
transitionVelocity,
null,
() => {
if (releaseGestureAction === 'pop') {
this._cleanScenesPastIndex(destIndex);
}
}
);
}
this._detachGesture();
},
Expand Down

0 comments on commit 97137e8

Please sign in to comment.