Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to disable gesture handling on the sheet's content #85

Closed
adamsoutar opened this issue Nov 26, 2020 · 5 comments
Closed

A way to disable gesture handling on the sheet's content #85

adamsoutar opened this issue Nov 26, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@adamsoutar
Copy link

Feature Request

Hi, for some controls on Android you can't replace the Touchables with ones from this lib. For example, a native <Switch /> or buttons/tabs from other 3rd party dependencies. This makes quite a few components unusable within sheets.

Is there a way to disable gesture handling on the content so only the handle is draggable, leaving normal touchables working in the sheet?

reanimated-bottom-sheet has enabledHeaderGestureInteraction , enabledContentGestureInteraction, and enabledContentTapInteraction props which can be composed to get this behaviour on Android.

As a side-note, is it possible to produce this behaviour already - perhaps by wrapping the content in a gesture handler and not allowing the events to propagate?

Possible implementation

The implementation might involve wrapping the header & content in separate TapGestureHandler/PanGestureHandlers, and allowing us to toggle whether each is wrapped in them using props.

Code sample

Usage might look something like:

<BottomSheet
      snapPoints={['40%', '70%']}
      enableHeaderGestures={true}
      enableContentGestures={false}
    >
 {/* ... content with native/3rd party controls for Android */}
</BottomSheet>
@adamsoutar adamsoutar added the enhancement New feature or request label Nov 26, 2020
@gorhom
Copy link
Owner

gorhom commented Nov 26, 2020

@adamsoutar thanks for submitting this enhancement, this already in progress , check #75 & #76 👏

@adamsoutar
Copy link
Author

Thank you! I should've looked harder first

@gorhom
Copy link
Owner

gorhom commented Nov 30, 2020

I just pushed an alpha release for v2, please try it and let me know :)

also check out the new documents website ( still in progress ) 🎉

yarn add @gorhom/bottom-sheet@2.0.0-alpha.2

@kamote
Copy link

kamote commented Feb 20, 2021

@gorhom This now works, thanks!
However BottomSheetModalProvider seems not working properly on this version

@phgn0
Copy link

phgn0 commented Sep 30, 2024

For anyone finding this from Google ... enableContentPanningGesture={false} seems to disable dragging gestures.

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

No branches or pull requests

4 participants