react-native-side-menu icon indicating copy to clipboard operation
react-native-side-menu copied to clipboard

Possible issues in landspace mode (after rotating)

Open grabbou opened this issue 8 years ago • 15 comments

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.

grabbou avatar Dec 17 '15 12:12 grabbou

How do you update the width and height parameters?

kadosh1000 avatar Mar 01 '16 00:03 kadosh1000

See onLayout prop on a View (react-native docs) ;)

grabbou avatar Mar 01 '16 18:03 grabbou

Do you have a fix for this issue?

DennisMG avatar Apr 04 '16 19:04 DennisMG

@aimadnet can you submit a PR?

Kureev avatar Sep 23 '16 09:09 Kureev

@Kureev done :)

aimadnet avatar Sep 23 '16 12:09 aimadnet

@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.

andrey-skl avatar Sep 26 '16 09:09 andrey-skl

@aimadnet, can you follow up on this?

Kureev avatar Sep 26 '16 18:09 Kureev

@Kureev yes sure @huston007 I made it working on my app without any issue, are u using deviceScreen width & height in your app?

aimadnet avatar Sep 26 '16 19:09 aimadnet

@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})}>

andrey-skl avatar Sep 26 '16 19:09 andrey-skl

@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 avatar Sep 26 '16 19:09 aimadnet

@aimadnet Okay, I'll check that tommorow. Thank you!

andrey-skl avatar Sep 26 '16 19:09 andrey-skl

@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

andrey-skl avatar Sep 27 '16 14:09 andrey-skl

@aimadnet And here is how it looks like http://www.giphy.com/gifs/3o6Ztd8FlZMEV0F1mg

andrey-skl avatar Sep 27 '16 14:09 andrey-skl

I'm having the same issue. Any update on this?

sesolaga avatar Aug 27 '19 15:08 sesolaga