MM-20184 Remove ios drawer hack and Fix right drawer partially shown on landscape (#3933)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
parent
99bbc79953
commit
cbae026f8e
1 changed files with 6 additions and 13 deletions
|
|
@ -120,16 +120,6 @@ export default class DrawerLayout extends Component {
|
|||
|
||||
componentDidMount() {
|
||||
Dimensions.addEventListener('change', this.handleDimensionsChange);
|
||||
if (Platform.OS === 'ios') {
|
||||
// on iOS force closing the drawers to prevent them for partially showing
|
||||
// when channging the device orientation, probably caused by RN61
|
||||
Animated.timing(this.openValue, {
|
||||
toValue: 0,
|
||||
duration: 10,
|
||||
easing: Easing.out(Easing.cubic),
|
||||
useNativeDriver: this.props.useNativeAnimations,
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
|
@ -198,9 +188,12 @@ export default class DrawerLayout extends Component {
|
|||
};
|
||||
/* Drawer styles */
|
||||
let outputRange;
|
||||
// ios main sidebar sits mostly under the main screen, with slight move
|
||||
const translateDistance = Platform.OS === 'ios' && drawerPosition === 'left' ?
|
||||
Math.floor(drawerWidth * 0.2) : drawerWidth
|
||||
let translateDistance = drawerWidth;
|
||||
if (Platform.OS === 'ios') {
|
||||
// ios main sidebar sits mostly under the main screen, with slight move
|
||||
translateDistance = drawerPosition === 'left' ?
|
||||
Math.floor(drawerWidth * 0.2) : Math.floor(drawerWidth * 1.2)
|
||||
}
|
||||
|
||||
if (this.getDrawerPosition() === 'left') {
|
||||
outputRange = [-translateDistance, 0];
|
||||
|
|
|
|||
Loading…
Reference in a new issue