[ReactNative] Fix Navigator empty scene issue

Summary:
In some situations, when quickly swiping back to a scene we are transitioning from, the scene is blank/missing. This is fixed by adding a check for the active gesture when we hide the scenes.

@public

Test Plan: Can no longer reproduce on simulator when quickly swiping back to the scene we are transitioning from
This commit is contained in:
Eric Vicenti 2015-05-11 21:54:25 -07:00 коммит произвёл Christopher Chedeau
Родитель ef339250b5
Коммит 02d875869a
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -659,11 +659,17 @@ var Navigator = React.createClass({
},
/**
* Hides scenes that we are not currently on or transitioning from
* Hides all scenes that we are not currently on, gesturing to, or transitioning from
*/
_hideScenes: function() {
var gesturingToIndex = null;
if (this.state.activeGesture) {
gesturingToIndex = this.state.presentedIndex + this._deltaForGestureAction(this.state.activeGesture);
}
for (var i = 0; i < this.state.routeStack.length; i++) {
if (i === this.state.presentedIndex || i === this.state.transitionFromIndex) {
if (i === this.state.presentedIndex ||
i === this.state.transitionFromIndex ||
i === gesturingToIndex) {
continue;
}
this._disableScene(i);