Open chankung opened 7 years ago
Here's my Drawer.
`<Drawer ref={(drawer) => { !this.state.drawer ? this.setDrawer(drawer) : null }} type={'overlay'} openDrawerOffset={100} closedDrawerOffset={0} captureGestures={true} panOpenMask={.1} panCloseMask={.9} relativeDrag={false} panThreshold={.25} content={Test} styles={drawerStyles} disabled={false} tweenDuration={350} tweenEasing={'linear'} acceptDoubleTap={false} acceptTap={false} acceptPan={true} tapToClose={true} negotiatePan={true} side={'left'}
`
Here's setState funtion
setDrawer = (drawer) => { this.setState({ drawer }); // return drawer; };
It can slide to open but cannot slide to close.
+1
Hi use the open prop to solve this problem.
<Drawer ... open={this.state.drawer} ... > <Content/> </Drawer>
call setDrawer(true) to open the drawer and call setDrawer(true) to close the it.
setDrawer(true)
Here's my Drawer.
`<Drawer ref={(drawer) => { !this.state.drawer ? this.setDrawer(drawer) : null }} type={'overlay'} openDrawerOffset={100} closedDrawerOffset={0} captureGestures={true} panOpenMask={.1} panCloseMask={.9} relativeDrag={false} panThreshold={.25} content={Test }
styles={drawerStyles}
disabled={false}
tweenDuration={350}
tweenEasing={'linear'}
acceptDoubleTap={false}
acceptTap={false}
acceptPan={true}
tapToClose={true}
negotiatePan={true}
side={'left'}
Here's setState funtion
setDrawer = (drawer) => { this.setState({ drawer }); // return drawer; };
It can slide to open but cannot slide to close.