Skip to content

Conversation

intergalacticspacehighway
Copy link
Contributor

@intergalacticspacehighway intergalacticspacehighway commented May 23, 2025

Description

Adds support for gestureEnabled prop on Android for form sheet presentation style. Previously this prop was iOS-only, but now it can control whether bottom sheets can be dismissed by dragging on Android. iOS is doing something similar by setting modalInPresentation and overriding presentationControllerShouldDismiss.

Changes

  • Added gestureEnabled support for Android form sheets - controls isDraggable and sheetClosesOnTouchOutside properties
  • Updated SheetDelegate to respect isGestureEnabled when configuring bottom sheet behavior
  • Removed Android platform check in NativeStackView to allow the gestureEnabled prop on Android
  • Updated documentation

Test code and steps to reproduce

Pass gestureEnabled false in formSheet presentation style and test FabricExample on android.

<Stack.Screen
  name="FormSheet"
  component={FormSheetScreen}
  options={{
    presentation: 'formSheet',
    gestureEnabled: false, <- this now works on Android too
  }}
/>

Checklist

delete example readme

initial value of sheetClosesOnTouchOutside
@intergalacticspacehighway
Copy link
Contributor Author

Note: we need to be careful in case we end up merging this PR. This line in React navigation passes explicit false for android platform, so it will disable gestures for bottom sheets with the changes in this PR. I am not sure if it is needed in react navigation since react native screens is already passing it as false for android. Also I don't think screens is handling the hardware back button pop, it is only using back button handler to update some config in search view. cc - @satya164 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant