[ReactNative] Navigator fix opacity reset for presented scene

Summary:
jumpN will call enableScene for the dest scene, which makes sure the scene can be made visible, but we need to avoid resetting the opacity for it when it is already the presented scene. There is already a check to make sure we don't reset opacity for the transitioningFrom scene.

@public

Test Plan: Fixes the issue on Android device when jumping to a scene that is already presented
This commit is contained in:
Eric Vicenti 2015-05-05 14:31:41 -07:00
parent 57348a4028
commit 86cfcbc77e
1 changed files with 2 additions and 1 deletions

View File

@ -689,7 +689,8 @@ var Navigator = React.createClass({
var enabledSceneNativeProps = {
left: sceneStyle.left,
};
if (sceneIndex !== this.state.transitionFromIndex) {
if (sceneIndex !== this.state.transitionFromIndex &&
sceneIndex !== this.state.presentedIndex) {
// If we are not in a transition from this index, make sure opacity is 0
// to prevent the enabled scene from flashing over the presented scene
enabledSceneNativeProps.opacity = 0;