0

I'm using a Native-Base Drawer component, and I'm setting the openDrawerOffset value myself to be 300 wide (see code below). My main problem is tapToClose is acting as if the drawer is the default width and only responding to a tap within the last 15% of the screen or so.

Is this a bug in native-base? And is there a workaround?

My code is below:

<Drawer
    tapToClose={true}
    openDrawerOffset={1 - (300 / Dimensions.get('window').width)} // this has to be 300 wide
    initializeOpen={true}
    ref={(ref) => { this.drawer = ref; }} // not really using this anymore
    content={
        <SideBarView navigator={this.navigator} closeDrawer={this.closeDrawer.bind(this)} />
    }
    onClose={() => this.closeDrawer()} >
    <MainViewTitlebar 
        title={this.props.title}
        openDrawer={this.openDrawer.bind(this)}
        navigation={this.props.navigation}>
    </MainViewTitlebar>
    <View style={styles.content}>
        {this.renderMainView()}
    </View>
</Drawer>
death_au
  • 1,282
  • 2
  • 20
  • 41

1 Answers1

0

You could set the panCloseMask prop same as openDrawerOffset to achieve that.