Repository navigation
Replies: 1 comment 2 replies
|
Hi @AlixH, since the I haven't run this against your project, and the question doesn't say which gesture you want off (closing by dragging down, or dragging the content), so the snippet covers both: const [isDeep, setIsDeep] = useState(false);
<BottomSheet
snapPoints={snapPoints}
enablePanDownToClose={!isDeep} // pan-down-to-close only on the root screen
enableContentPanningGesture={!isDeep} // optional: also lock dragging from the content
enableHandlePanningGesture={!isDeep} // optional: also lock dragging from the handle
>
<NavigationIndependentTree>
<NavigationContainer
onStateChange={(state) => {
// state.index > 0 means you've pushed past the first screen of the root stack
setIsDeep((state?.index ?? 0) > 0);
}}
>
<Stack.Navigator>...</Stack.Navigator>
</NavigationContainer>
</NavigationIndependentTree>
</BottomSheet>Notes:
|
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am using the
NavigationIndependentTreefrom react-navigation like in the provided example . My goal is to disable pan down gesture when inside the tree (not in the bottom sheet root)All reactions