Skip to content

Drawer not works as expected #2302

@thundernet8

Description

@thundernet8

Issue Description

startTabBasedApp, add left menu screen as drawer, gesture or toggleDrawer API never call the left menu successfully.

I tried any hacks from those issues. e.g. remove to: "open", set fixed width of drawer screen, but always failed

Steps to Reproduce / Code Snippets / Screenshots

Navigation.startTabBasedApp({
        tabs: [
            {
                label: "Feeds",
                screen: Screen.HOMEFeedsTab,
                icon: icons[0],
                title: "Feeds",
                navigatorButtons: {
                    leftButtons: [
                        {
                            id: "sideMenu"
                        }
                    ]
                }
            },
            {
                label: "Issues",
                screen: Screen.HOMEIssuesTab,
                icon: icons[1],
                title: "Issues",
                navigatorButtons: {
                    leftButtons: [
                        {
                            id: "sideMenu"
                        }
                    ]
                }
            }
        ],
        drawer: {
            left: {
                screen: Screen.LeftMenu,
                passProps: {}
            },
            disableOpenGesture: false
        }
    });

screen which has the menu button:

constructor(props) {
        super(props);
        this.props.navigator.setOnNavigatorEvent(this.onNavigatorEvent);
    }

    onNavigatorEvent = event => {
        console.log(event);
        if (event.type === "NavBarButtonPress") {
            if (event.id === "sideMenu") {
                this.props.navigator.toggleDrawer({
                    side: "left" // the side of the drawer since you can have two, 'left' / 'right'
                    // animated: true,
                    // to: "open" 
                });
            }
        }
    };

Environment

  • React Native Navigation version: 1.1.298
  • React Native version: 0.51.0
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Nexus_5X_API_27_x86(AVD) - 8.1.0 and SM-N9500 - 7.1.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions