From 8975bb8e70948ea4b5938913ab12f1857cc4cb43 Mon Sep 17 00:00:00 2001 From: Hedger Wang Date: Fri, 13 May 2016 12:54:59 -0700 Subject: [PATCH] `didFocus` event should fired after transition finishes. Summary: For now, we emit `didFocus` event before fully resetting the transition and hiding the stale scenes, so handler for `didFocus` event does not get the right scenes in place. We should emit the didFocus event after resetting the transition and hiding the stale scenes. Reviewed By: ericvicenti Differential Revision: D3299002 fbshipit-source-id: 6a79528097aabc4f61d4dba322820c228c889a84 --- Libraries/CustomComponents/Navigator/Navigator.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Libraries/CustomComponents/Navigator/Navigator.js b/Libraries/CustomComponents/Navigator/Navigator.js index 3974cdd5b9d35a..e1aa9ed091b766 100644 --- a/Libraries/CustomComponents/Navigator/Navigator.js +++ b/Libraries/CustomComponents/Navigator/Navigator.js @@ -1,5 +1,10 @@ /** - * Copyright (c) 2015, Facebook, Inc. All rights reserved. + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * Facebook, Inc. ("Facebook") owns all right, title and interest, including * all intellectual property and other proprietary rights, in and to the React @@ -446,7 +451,7 @@ var Navigator = React.createClass({ this._onAnimationEnd(); var presentedIndex = this.state.presentedIndex; var didFocusRoute = this._subRouteFocus[presentedIndex] || this.state.routeStack[presentedIndex]; - this._emitDidFocus(didFocusRoute); + if (AnimationsDebugModule) { AnimationsDebugModule.stopRecordingFps(Date.now()); } @@ -457,6 +462,9 @@ var Navigator = React.createClass({ this.state.transitionCb(); this.state.transitionCb = null; } + + this._emitDidFocus(didFocusRoute); + if (this._interactionHandle) { this.clearInteractionHandle(this._interactionHandle); this._interactionHandle = null;