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

fix drawer side "right" margin progressively increase #352

Merged
merged 2 commits into from
Oct 2, 2018

Conversation

mtiziano
Copy link
Contributor

also reported here #349

@mstf0ta-app
Copy link

thank you very much .
this solve my problem too

@ItsNoHax
Copy link

Not a good fix, still breaks on iPhone PLUS or iPhone X models.

@mtiziano
Copy link
Contributor Author

Thanks @ItsNoHax, it was a problem handling onPanResponderMove.
Now it should be fine

@engorila
Copy link

engorila commented May 15, 2018

I don't understand your solution... and it not run on iPad.

To fix all you have to change updatePosition method. Add Math.round inside switch (in my case overlay):

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

@ItsNoHax
Copy link

@engorila Your fix doesn't work either, it still happens eventhough at a much smaller pace. I don't see how a Math.round can be a proper fix. I feel like you guys are programming by guessing.

@gersonmontenegro
Copy link

@engorila thanks, works fine for me, even in real devices like iPhone 5 and iPad mini, as in emulators.

@SupriyaKalghatgi
Copy link

@rt2zz When can we get this merged?

@amitmaurya0
Copy link

can any one tell me how and where to implement this updatePosition ?

@anjalsan
Copy link

anjalsan commented Jun 5, 2018

@SupriyaKalghatgi When this fix reflect on nativebase?

@anjalsan
Copy link

anjalsan commented Jun 5, 2018

@amitmaurya0 inside node_modules/react-native-drawer/index.js line number 210 in the latest version. you can change that line with this
drawerProps[this.props.side] = Math.round(-this.getDeviceLength() + this._offsetOpen + this._length)

@sdg9
Copy link
Contributor

sdg9 commented Jul 11, 2018

For what it's worth I did a git bisect between the react-native 0.54.x and 0.55.x and found that this commit in React Native is what causes the problem, at least when testing on iPhone X simulator. I don't have a solution yet.

@madyankin
Copy link

@rt2zz pleeeeease!

@roycclu
Copy link

roycclu commented Aug 7, 2018

Have tried @Numez and @anjalsan .
Works on most models.
Doesn't work on iPhoneX.
It reduces the problem to a much slower pace, but still there.

Only appears on RN 0.55, so reverting back to RN.0.54.
Can anyone confirm if this still an issue in RN 0.56?

@madyankin
Copy link

@roycclu you can try my fork https://github.com/outpunk/react-native-drawer.

@roycclu
Copy link

roycclu commented Aug 8, 2018

@Outpunk sure will try.
Can you make a PR so it's obvious to see the changes you made against main repository?
Thanks.

@madyankin
Copy link

@roycclu
Copy link

roycclu commented Aug 8, 2018

@Outpunk
dood, doesn't work.
looks like the only change you made was line 30 in tweener.js

this._config.onFrame(Math.round(tweenVal));

Problem still present on iPhoneX, just to a smaller degree

@madyankin
Copy link

@roycclu Can the bug be reproduced in iOS simulator?

@nguyenvanphuc2203
Copy link

any update ?

@roycclu
Copy link

roycclu commented Aug 13, 2018

The bug can be repro in simulator.
Currently I reverted down to RN 53. (RN54 also works.)

To repro, make a horizontal listview in the main page, and as you open and close drawer, the cells in the listview shrink.

Currently busy with our app launch. Will try making a repro when I have time. But yea problem is fairly obvious.

@madyankin
Copy link

@roycclu It would be nice to have one. I'm a bit busy to tackle this now, but I have to support iPhone X, too. So I'll dig into this later if nobody solves the issue until then.

@uc-asa
Copy link

uc-asa commented Sep 12, 2018

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

That's work for me.

Thanks @amitmaurya0

@jdestep93
Copy link

Works well thanks @amitmaurya0

@irqequirecoffee
Copy link

Just stopping by to say thanks to @amitmaurya0, this fix worked for me as well.

@rt2zz rt2zz merged commit 96a79b8 into root-two:master Oct 2, 2018
@rt2zz
Copy link
Member

rt2zz commented Oct 2, 2018

thanks @amitmaurya0 !

@predator-1
Copy link

You can make even openDrawerOffset. I had openDrawerOffset={0.33} and it has bug. But
openDrawerOffset={0.34} all ok

@adnan1naeem
Copy link

adnan1naeem commented Nov 22, 2018

@anjalsan solution is working fine please release new version with the prescribed solution

@chiasheang
Copy link

chiasheang commented Jan 28, 2019

@amitmaurya0 inside node_modules/react-native-drawer/index.js line number 210 in the latest version. you can change that line with this
drawerProps[this.props.side] = Math.round(-this.getDeviceLength() + this._offsetOpen + this._length)

Works on most models.
Doesn't work on iPhoneX and iPhone Plus models when I set openDrawerOffset = {0.3} and open it for more than 7 times
But working fine if I set openDrawerOffset = {0.28}

Hope someone can figure out what are the problems.

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

Successfully merging this pull request may close these issues.