root-two / react-native-drawer

React Native Drawer
MIT License
2.54k stars 392 forks source link

drawer width decreases on open and close #370

Open adnan1naeem opened 5 years ago

adnan1naeem commented 5 years ago

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)

GeekRishabh commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

Dimon70007 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

I have found solution - https://github.com/root-two/react-native-drawer/pull/352#issuecomment-389238360

Dimon70007 commented 5 years ago

Hi @demothreen. You can try https://github.com/root-two/react-native-drawer/pull/372 in your project.

demothreen commented 5 years ago

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 commented 5 years ago

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.