Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drawer width decreases on open and close #370

Open
adnan1naeem opened this issue Nov 22, 2018 · 9 comments
Open

drawer width decreases on open and close #370

adnan1naeem opened this issue Nov 22, 2018 · 9 comments

Comments

@adnan1naeem
Copy link

adnan1naeem commented Nov 22, 2018

I was having issue of drawer width .when i open and close and then reopen the drawer width was closed.It continuously decrease after reopening it.I found its solution kindly replace 210 line of react-native-drawer/index.js componet with the following line.Then it would be resolved .Kindly update and release this version.

instead of this ----> drawerProps[this.props.side] = -this.getDeviceLength() + this._offsetOpen + this._length

place this-----> drawerProps[this.props.side] = Math.round(-this.getDeviceLength() + this._offsetOpen + this._length)

@adnan1naeem adnan1naeem changed the title My drawer width decreases on open and close drawer width decreases on open and close Nov 22, 2018
@rishabh-pandey-sternx
Copy link

This still doesn't work for devices X and X plus devices. Can anyone update on this issue. I am using this in production and its breaking things

@Dimon70007
Copy link

Hi guys. You should pass props styles for correct setting initial position of drawer

styles  = {{
  drawer: { shadowColor: '#000000', shadowOpacity: 0.8, shadowRadius: 3 },
  main: { paddingLeft: 3 },
}};

With this prop Drawer works correctly

@demothreen
Copy link

Hello, @Dimon70007! Have you tested it on an iPhone X? Because it doesn't help me :(

@Dimon70007
Copy link

Hello, @Dimon70007! Have you tested it on an iPhone X? Because it doesn't help me :(

Hi @demothreen. Drawer from "native-base": "^2.12.1" works fine for me.
You can try my code - https://gist.github.com/Dimon70007/56a0e526dade746b3bc967e8ee72011d

@Dimon70007
Copy link

confirm - on Iphone XS have reproduced this bug
Same bug appears when using absolute positioning with animating. but with

transform: [{
      translateX: value,
    }],

animating works fine on iphone

@Dimon70007
Copy link

I have found solution - #352 (comment)

@Dimon70007
Copy link

Hi @demothreen. You can try #372 in your project.

@demothreen
Copy link

Hi @Dimon70007! I have not tried your changes. For my project I have already used DrawerLayout from "react-native-gesture-handler" - for ios and android works great for me!

@Dimon70007
Copy link

Hi @Dimon70007! I have not tried your changes. For my project I have already used DrawerLayout from "react-native-gesture-handler" - for ios and android works great for me!

Thank you very much. I've adopted this DrawerLayout for my App. It looks better then js Drawer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants