From 5189c94a6e876ef5274b22c083034a561ef3d5e8 Mon Sep 17 00:00:00 2001 From: Hedger Wang Date: Tue, 12 Jul 2016 17:39:10 -0700 Subject: [PATCH] Fix Navigator transition. Summary: Fix the bug reported as https://github.com/facebook/react-native/pull/8071 Reviewed By: fkgozali Differential Revision: D3553062 fbshipit-source-id: 286feddc268f51c0d9005a8831640c5e6af4880e --- Libraries/CustomComponents/Navigator/Navigator.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index 63b53b03f2..d5fbd0674c 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -501,13 +501,13 @@ var Navigator = React.createClass({ }, _transitionTo: function(destIndex, velocity, jumpSpringTo, cb) { - if ( - destIndex === this.state.presentedIndex && - this.state.transitionQueue.length === 0 - ) { + if (this.state.presentedIndex === destIndex) { + cb && cb(); return; } + if (this.state.transitionFromIndex !== null) { + // Navigation is still transitioning, put the `destIndex` into queue. this.state.transitionQueue.push({ destIndex, velocity,