How to disable sideMenu on current window even user swipe right or left on the screen
In your screen constructor add the following:
this.props.navigator.setDrawerEnabled({
side: "left",
enabled: false,
screen: "Drawer"
});
This feature is in the document
@pqkluan I am looking for the solution in RNN V2 not in V1
Still i can't disable side menu in screen.
Navigation.setRoot({
root: {
sideMenu: {
center: {
stack: {
options: {
animated: false,
},
id: 'SplashStack',
children: [
{
component: {
name: 'Splash',
options: {
topBar: {
visible: false,
drawBehind: true,
animate: false,
layout: {
backgroundColor: 'transparent',
}
},
sideMenu: {
right: {
visible: false,
enabled: false
},
left: {
visible: false,
enabled: false
},
},
}
}
}
]
}
},
right: {
component: {
name: 'DrawerLayout',
}
}
},
}
});
I even try
static get options() {
return {
sideMenu: {
right: {
enabled: false
}
}
}
};
But it didn't help
========
I have same issue
I'm migrating from react-navigation and looking for this feature too.
IMO, it shouldn't be done on setRoot as mentioned/tried above.
It should be on static get options
or even something like setDrawerEnabled
from v1.
Thanks :)
same issue it doesn't work on Android in wix navi v2
but it works well on IOS
javascript
Navigation.push(Screens.ApplicationList.name,
{
component: {
id : Screens.ApplicantDetailView.name,
name: Screens.ApplicantDetailView.name,
passProps: {
applicant: applicant,
index: 0,
},
options: {
topBar: { visible: false, drawBehind: true },
sideMenu: {
left: {
visible: false,
enabled: false
}
},
}
}
}
);
j
Should be fixed now. thanks!
@yogevbd Nice work. Thanks!
@yogevbd this issue has only been resolved on ios.
It still does not work on android. i both checked by testing and looking at the source code.
shouldn't this issue be reopend as there is no android implementation and the the issue indicates on both platforms.
I'm saying this because it was part of the project and now it went to the Done category and looks like it has both platforms covered.
@sJJdGG did you find any solution .
@yogevbd Did the team fix the issue
thanks
RNN v:2.0.2425
RN v:0.56
not to be a pain but this is turning into a major issue in our application. Is there a guess on when we might see this added? As a work around I have tried to use the react-native's DrawerLayoutAndroid but react-native-navigations modals seems to mess it up (the ref links seem to return undefined for the drawer after opening a modal)
Any chance to have this fixed on Android?
You can use this to disable sideMenu:
Navigation.mergeOptions(this.props.componentId, {
sideMenu: {
left: {
enabled: false
}
}
});
And this to enable:
Navigation.mergeOptions(this.props.componentId, {
sideMenu: {
left: {
enabled: true
}
}
});
static options(passprops) {
return {
topBar: {
visible: false,
drawBehind: true
} ,
sideMenu : {
right : {
visible : false ,
enabled : false
}
}
};
}
Most helpful comment
@yogevbd this issue has only been resolved on ios.
It still does not work on android. i both checked by testing and looking at the source code.
shouldn't this issue be reopend as there is no android implementation and the the issue indicates on both platforms.
I'm saying this because it was part of the project and now it went to the Done category and looks like it has both platforms covered.