-
Notifications
You must be signed in to change notification settings - Fork 734
Carousel - fix page width issue #570
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
Conversation
@@ -107,7 +107,8 @@ export default class Carousel extends BaseComponent { | |||
|
|||
onOrientationChanged = () => { | |||
if (!this.props.pageWidth || this.props.loop) { | |||
this.setState({pageWidth: Constants.screenWidth}); | |||
// HACK: setting to containerWidth for Android's call when view disappear | |||
this.setState({pageWidth: this.state.containerWidth || Constants.screenWidth}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both old code and new code looks strange, does it work for non full-width pages?
if we're setting the pageWidth
to screenWidth or containerWidth, doesn't it break the non-full page feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Inbal-Tish I think this fix breaks iOS when changing orientation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't break the non-full width since there is a condition on line #111. The odd thing is that this.props.pageWidth
is undefined there for some reason...
I see an issue with orientation change in the dynamic width feature as well. I'll take a look and talk to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was an issue with the update.initialOffset (used initialPage instead of state.currentPage). That might be the orientation issue you had? I added a fix so let me know if that worked or there was another issue in orientation.
fix for Android's call (bug) to onOrientationChange when view disappears