Skip to content

Conversation

MatiPl01
Copy link
Contributor

@MatiPl01 MatiPl01 commented Jun 24, 2024

Description

This PR fixes the issue we noticed in our app. When list items rendered in the bottom sheet are wrapped with the ContextMenuView component, the context menu is popping up while the list was scrolled. The problem is likely caused by the fact that the @gorhom/bottom-sheet library uses the react-native-gesture-handler, which somehow interferes with the native gesture handler. As a result, the Android's gesture detector didn't recognize the scroll event, and thus, the long press was fired, even though the user scrolled the list.

Screen capture

Before After
Screen_Recording_20240624_110532_Uniswap.Dev.1.mp4
Screen_Recording_20240624_114012_Uniswap.Dev.1.mp4

@MatiPl01 MatiPl01 marked this pull request as ready for review June 25, 2024 08:44
@MatiPl01
Copy link
Contributor Author

@mpiannucci I found this problem in our app on Android devices. It doesn't seem to be a common issue as I haven't came across any reports, but maybe this or similar fix could be implemented if you don't mind.

Copy link
Owner

@mpiannucci mpiannucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much, works for my testing too

@mpiannucci mpiannucci merged commit 8ac1c21 into mpiannucci:main Jun 25, 2024
@ceejayvarias
Copy link

Is there an ETA of when this fix would be released?

@Mukhammadali
Copy link

This issue can still be reproduced if pull-to-refresh is enabled on any list, as this fix only checks for a scroll distance of 10 pixels

@MatiPl01
Copy link
Contributor Author

MatiPl01 commented Apr 8, 2025

Yeah, it isn't perfect but there is not an easy way to prevent the native gesture detector from handling the gesture. I just added an implementation that makes it work better than before but there might be cases in which it is not sufficient.

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.

4 participants