[V2] No way to disable open/close gestures for drawer
Issue Description
Currently as I understand there is no way to disable open/close gestures for the drawer. This functionality is required when there is horizontally swiping UI elements (lists with swipe rows for example), otherwise it interferes and make them unusable.
Steps to Reproduce / Code Snippets / Screenshots
Nothing to reproduce the functionality is just missing.
Environment
- React Native Navigation version: 2.0.2485
- React Native version: 0.56.0
- Platform(s) (iOS, Android, or both?): both
- Device info (Simulator/Device? OS version? Debug/Release?): any
I think I found a workaround. It can be completely disabled when not visible:
Navigation.mergeOptions('sideDrawer', {
sideMenu: {
right: {
visible: false,
enabled: false,
}
}
})
Still I feel like this is kind of a hack rather than a solution. Also, I have another issue with this workaround: https://github.com/wix/react-native-navigation/issues/3837.
The Android SideMenuOptions don’t seem to include an enabled flag: https://github.com/wix/react-native-navigation/blob/v2/lib/android/app/src/main/java/com/reactnativenavigation/parse/SideMenuOptions.java
Are you sure this is working?
+1 to this issue - I don't find that the sideMenu enabled has any effect in android and there for can not disable the drawer from gestures.
@haggholm did you try with the version 2.0.2485 and with the exact code I mentioned above (using mergeOptions?). Also that way it worked only on iOS (I'm mentioning this in the issue I referenced above #3837). On Android neither way worked for me.
@guyca, is there currently a way / workaround to disable open/close gestures for drawer that would work on both platforms? Thank you for letting us know.
@terreb I don’t really work with iOS, so no, I only tried Android. In Android, the option doesn’t even seem to be an option.
To disable swipe gesture or open /close the drawer programmatically, I set enabled to false as default option, and just toggle the visible property on button click
// button onClick function:
Navigation.mergeOptions('sideDrawer', {
sideMenu: {
right: {
visible: false/true,
}
}
})
I tried this and works for Android only. In ios, the swiperow gets stuck. v2.1.3 https://github.com/wix/react-native-navigation/issues/3575
I think I found a workaround. It can be completely disabled when not visible:
Navigation.mergeOptions('sideDrawer', { sideMenu: { right: { visible: false, enabled: false, } } })Still I feel like this is kind of a hack rather than a solution. Also, I have another issue with this workaround: #3837.
@terreb yep, it works when it's not visible. But, how to turn it off when it's visible? :) popGesture: false didn't work for me :/
@chelovekdrakon, sorry I don't know how to disable gestures when it's open. For the project I was working on disabling it when not visible was enough. Try stackoverflow maybe.
@chelovekdrakon, sorry I don't know how to disable gestures when it's open. For the project I was working on disabling it when not visible was enough. Try stackoverflow maybe.
Ten four :) Thank you for the reply anyway!