You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[50$] Feature Request / Bug Report - iOS / Android onPress action for <ContextMenu.Trigger> that doesn't conflict with normal the actual ContextMenu Deployment
#145
First of all, I want to show my sincere appreciation for this library and all the wonderful docs. Its absolutely phenomenal.
This issue has sort of been bothering me in our app for a while. There is a "workaround" available for iOS, which I'm not a huge fan of, but it's still flaky on Android.
Desired Functionality:
I wrap my some content in my app with a <ContextMenu>. That content is a wrapped in a TouchableOpacity. The functionality I desire is:
User quickly taps on that content, it takes them to play the video or full screen the image (similar to the repro)
If a user long presses on the content, they can "Share", "Comment" or "Delete" (all options within my Context Menu)
The Problem
The onPress of my "Touchable" currently interacts with the deployment of the <ContextMenu/>. When you long tap on the context menu it also fires the onPress of the button. Here is a video of the issue.
The Workaround (Identified here)
On iOS the workaround fairly solid. You essentially make the onLongPress of the inner Touchable an empty function like so:
<ContextMenu.Triggeraction="longPress"><TouchableOpacityonPress={onQuickPress}/**THIS IS A WORKAROUND TO AVOID ACCIDENTAL FIRING OF BUTTON */onLongPress={()=>{}}activeOpacity={0.7}>{children}</TouchableOpacity></ContextMenu.Trigger>
Note: It seems to work well on iOS and Android via simulator, but in reality, just scrolling on a real android device triggers this context menu sometimes. It's just not an ideal user experience. Really this needs a real solution where the context menu itself has its on onPress event that handles all of this stuff.
First of all, I want to show my sincere appreciation for this library and all the wonderful docs. Its absolutely phenomenal.
This issue has sort of been bothering me in our app for a while. There is a "workaround" available for iOS, which I'm not a huge fan of, but it's still flaky on Android.
Desired Functionality:
I wrap my some content in my app with a
<ContextMenu>
. That content is a wrapped in aTouchableOpacity
. The functionality I desire is:The Problem
The
onPress
of my "Touchable" currently interacts with the deployment of the<ContextMenu/>
. When you long tap on the context menu it also fires theonPress
of the button. Here is a video of the issue.The Workaround (Identified here)
On iOS the workaround fairly solid. You essentially make the
onLongPress
of the innerTouchable
an empty function like so:Video Detailing Issue
https://github.com/user-attachments/assets/7e0e58e9-1285-4d54-936e-db4f2b297964
Note: It seems to work well on iOS and Android via simulator, but in reality, just scrolling on a real android device triggers this context menu sometimes. It's just not an ideal user experience. Really this needs a real solution where the context menu itself has its on
onPress
event that handles all of this stuff.Reproduction:
yarn install
npx expo run:ios --device
/npx expo run:android --device
Note:
There are quite a few related issues that detail this exact topic:
TouchableWithoutFeedback
as triggeronPressIn/Out
has a weird behavior dominicstop/react-native-ios-context-menu#123(Slightly less related issue)
The text was updated successfully, but these errors were encountered: