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

Question: Preventing sheet from closing when interacting with elements (Android) #141

Open
szheleshchenko opened this issue Feb 24, 2025 · 2 comments

Comments

@szheleshchenko
Copy link

Hey, I ran into an issue on Android where the sheet closes when interacting with elements inside it (like a DatePicker, but could be any interactive element). On iOS, the sheet stays open when using

<View
  onStartShouldSetResponder={() => true}
  onResponderTerminationRequest={() => false}
/>

but on Android, these props don't work.

I tried to workaround it with adding a ScrollView and passing scrollRef to the sheet, but that was no use.

Is there a way to prevent this behavior on Android without disabling the sheet's movement altogether? It's a pretty common use case to have interactive elements inside the bottom sheet that shouldn’t trigger a close action when touched.

Would love some help or suggestions on how to handle this. Thanks! 🙌

@lodev09
Copy link
Owner

lodev09 commented Feb 24, 2025

Hey @szheleshchenko, do you have a reproducible example?

@szheleshchenko
Copy link
Author

@lodev09 Yes, I created an example using DatePicker. https://github.com/szheleshchenko/true-sheet-reproduction/blob/master/app/index.tsx

Here's how it looks:

Details
video_2025-02-25_16-38-04.mp4

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

No branches or pull requests

2 participants