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

[Bug]: Android - Can't click Pressables inside Scrollview that is alongside my BottomSheet both inside a GestureHandlerRootView #2099

Open
r-obeen opened this issue Jan 1, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@r-obeen
Copy link

r-obeen commented Jan 1, 2025

Version

v5

Reanimated Version

v3

Gesture Handler Version

v2

Platforms

Android

What happened?

When I have a BottomSheet into my ScrollView and I scroll a bit, my Pressables in my ScrollView are not responding anymore... If I remove the BottomSheet component, it works again...

It only happens on Android (physical phone, I have tested on Android 14). It works fine on physical iPhone, iPhone simulator and Android Simulator 🤔.

Any idea why that happens ?

Demo (sorry, I recorded on a very slow Android phone, I've tested on fast Android phone, same issue) :
https://github.com/user-attachments/assets/53510520-63a6-4dab-8307-55871a95c80c

Reproduction steps

  • Open the Snack on a real Android device (using Expo Go)
  • Before scrolling down, press on Button 1 or Button 2, it should open the sheet
  • Scroll down and try to press Button 1 or Button 2 again, it will not open the sheet anymore

If you remove the<BottomSheet> component (with its children), button presses will work fine, even after scroll

Reproduction sample

https://snack.expo.dev/@robeen/bottomsheet-press-issue-after-scroll?platform=android

Relevant log output

No response

@r-obeen r-obeen added the bug Something isn't working label Jan 1, 2025
@Chanki-Min
Copy link

Chanki-Min commented Jan 14, 2025

I'm experiencing the same issue. For the child components of the ScrollView, the onPress callbacks work correctly for any components that were initially rendered at the top (the initial scroll position).

However, if I scroll down and tap on components that were not visible in the initial scroll position (In other words, components ware hidden), their onPress callbacks do not fire.

@CHOIMINSEOK
Copy link

FYI;
If you set enableContentPanningGesture as false in BottomSheetModal, it blocks all touch events in ScrollableContents after the content scrolls down. BottomSheetModal makes scroll handler bridge (BottomSheetDraggableView) internally, but when enableContentPanningGesture=false, the bridge is replaced by normal Animated.View, which seems to break Android touch chains in android real device

    // render
    const DraggableView = enableContentPanningGesture
      ? BottomSheetDraggableView
      : Animated.View;

const DraggableView = enableContentPanningGesture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants