Fix race condition when clicks are received on react root view and react context is pending

Reviewed By: astreet

Differential Revision: D3297574

fbshipit-source-id: 27ac81342d19947e9425a845d7ef7c73cc4cf090
This commit is contained in:
Olivier Notteghem 2016-05-13 09:34:49 -07:00 committed by Facebook Github Bot 1
parent cc683bc088
commit fd376660df

View File

@ -119,9 +119,16 @@ public class EventDispatcher implements LifecycleEventListener {
event.getEventName(),
event.getUniqueID());
}
if (mRCTEventEmitter != null) {
// If the host activity is paused, the frame callback may not be currently
// posted. Ensure that it is so that this event gets delivered promptly.
mCurrentFrameCallback.maybePostFromNonUI();
} else {
// No JS application has started yet, or resumed. This can happen when a ReactRootView is
// added to view hierarchy, but ReactContext creation has not completed yet. In this case, any
// touch event dispatch will hit this codepath, and we simply queue them so that they
// are dispatched once ReactContext creation completes and JS app is running.
}
}
@Override