Skip to content

Commit

Permalink
didFocus event should fired after transition finishes.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Hedger Wang authored and Facebook Github Bot 4 committed May 13, 2016
1 parent 2849baf commit 8975bb8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Libraries/CustomComponents/Navigator/Navigator.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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());
}
Expand All @@ -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;
Expand Down

0 comments on commit 8975bb8

Please sign in to comment.