react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[V2] Blank screen when popping an animating pushed screen

Open denisloch opened this issue 7 years ago • 4 comments

Issue Description

I have a root screen, and a screen I would like to push on top of that. That works fine. But when I pop the screen while it's animating (doing the push animation), it gives me a blank screen with no contents on it. I have no idea why this is happening.

va6g6bvg

I have attached an example and set the animation duration to 5000 for showcasing purposes.

Some relevant code:

index.js

Navigation.events().registerAppLaunchedListener(() => {
    Navigation.setRoot({
        root: {
            sideMenu: {
                id: "sideDrawer",
                left: {
                    component: {
                        name: "global.Drawer",
                    },
                },
                options: {
                    sideMenu: {
                        left: {
                            width: 290
                        }
                    }
                },
                center: {
                    stack: {
                        id: "centerStack",
                        children: [{
                            component: {
                                name: "component1.Main"
                            }
                        }],
                        options: {
                            topBar: {
                                visible: false,
                                animate: false,
                                drawBehind: true
                            },
                            statusBar: {
                                backgroundColor: "rgba(0, 0, 0, .2)",
                                drawBehind: true,
                                visible: true
                            }
                        }
                    },
                }
            },
        }
    });
});

Navigation.setDefaultOptions({
    statusBar: {
        backgroundColor: "rgba(0, 0, 0, .2)",
        drawBehind: true,
        visible: true,
    }
})

Pushing the new screen:

Navigation.push(this.props.componentId, {
    component: {
        name: target,
            options: {
                animations: {
                    push: {
                        enabled: true,
                        waitForRender: true,
                        content: {
                            y: {
                                from: 250,
                                to: 0,
                                duration: 5000,
                                interpolation: 'decelerate',
                            },
                        alpha: {
                            from: 0,
                            to: 1,
                            duration: 150
                        }
                    },
                    pop: {
                        enabled: true,
                        waitForRender: true,
                        content: {
                            y: {
                                from: 0,
                                to: 300,
                                duration: 150,
                                interpolation: 'accelerate',
                            },
                            alpha: {
                                from: 1,
                                to: 0,
                                duration: 150,
                            }
                        }
                    }
                }
            }
    });

Environment

  • React Native Navigation version: 2.4.0
  • React Native version: 0.57.8
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator (Pixel 2 XL - Android 9.0.0) and Device (OnePlus 3 - Android 8.0.0), both Debug and Release mode.

denisloch avatar Jan 08 '19 16:01 denisloch

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

stale[bot] avatar Feb 07 '19 17:02 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Feb 14 '19 17:02 stale[bot]

No one seems to help with this issue, this bug is annoying

msqar avatar Dec 31 '19 00:12 msqar

same here :(

mrquanghuy avatar Jan 21 '20 07:01 mrquanghuy