react-native-side-menu
react-native-side-menu copied to clipboard
Possible issues in landspace mode (after rotating)
Looks like we are still referring to deviceScreen
in some places instead of this.state.width && this.state.height
- (e.g. in handleMoveShouldSetPanResponder) after device has been rotated - these properties may (and probably will) change. We have to check that out.
It also glitches when opening menu with a gesture from landscape mode - it reveals underlying white background between Menu and Right content.
How do you update the width and height parameters?
See onLayout
prop on a View (react-native docs) ;)
Do you have a fix for this issue?
I have fixed this here: https://github.com/aimadnet/react-native-side-menu/commit/f2b1b2cda96c185c9e6df42d15f7d85b1c49cf77
@aimadnet can you submit a PR?
@Kureev done :)
@aimadnet @Kureev Guys I tried 0.20.1 and I can't confirm that issue is gone - it still has wrong layout after rotating, as before.
@aimadnet, can you follow up on this?
@Kureev yes sure @huston007 I made it working on my app without any issue, are u using deviceScreen width & height in your app?
@aimadnet Thanks for helping! No, I'm not using height, that how it looks:
<SideMenu
menu={<Menu onLogOut={this.logOut.bind(this)}
user={this.props.auth.currentUser}
backendUrl={this.props.auth.config.backendUrl}
/>}
isOpen={this.state.showMenu}
openMenuOffset={260}
onChange={isOpen => this.setState({showMenu: isOpen})}>
@huston007 try to take out openMenuOffset={260} and check again.
If it doesn't work go to node_modules/react-native-side-menu/index.js
right after the line 217 this.setState({ width, height, openMenuOffset, hiddenMenuOffset });
add this line:
console.log("sidemenu log", "width:"+width, "height:"+height, "openMenuOffset:"+openMenuOffset);
and send us the console output before and after rotating
@aimadnet Okay, I'll check that tommorow. Thank you!
@aimadnet Okay I perfomed this. Removing openMenuOffset didn't help to me. Here is the log:
[Initial log in vertical orientation]
sidemenu log width:375 height:667 openMenuOffset:250
[Rotating right]
index.js:218 sidemenu log width:667 height:375 openMenuOffset:444.66666666666663
[Rotating back left to initial state]
index.js:218 sidemenu log width:375 height:667 openMenuOffset:250
@aimadnet And here is how it looks like http://www.giphy.com/gifs/3o6Ztd8FlZMEV0F1mg
I'm having the same issue. Any update on this?