From 02d875869a18f0ce5b502c614330fb5f1ddbaed7 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Mon, 11 May 2015 21:54:25 -0700 Subject: [PATCH] [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 --- Libraries/CustomComponents/Navigator/Navigator.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index 6d89faf22..c8263c4a8 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -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);