GeezerVison is showing github.com — [50$] Feature Request / Bug Report - iOS / Android `onPress` action for <ContextMenu.Trigger> that doesn't conflict with normal the actual ContextMenu Deployment · Issue #145 · nandorojo/zeego
[50$] Feature Request / Bug Report - iOS / Android onPress action for <ContextMenu.Trigger> that doesn't conflict with normal the actual ContextMenu Deployment #145DescriptionFirst 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.Trigger action="longPress">
<TouchableOpacity
onPress={onQuickPress}
/**THIS IS A WORKAROUND TO AVOID ACCIDENTAL FIRING OF BUTTON */
onLongPress={() => {}}
activeOpacity={0.7}
>
{children}
</TouchableOpacity>
</ContextMenu.Trigger>
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:
- Clone Repro: https://github.com/ChristopherGabba/ContextMenu-Press-Repo
- Run
yarn install
- Run
npx expo run:ios --device / npx expo run:android --device
Note:
There are quite a few related issues that detail this exact topic:
Reacted by Antoine Rey, Simon Manzler, Teflo, Jan Ziemba and Andrei Vakulski Reacted by lee@cuong666 and Andrei Vakulski Activitykrevnekak commented on Mar 21, 2025 bogdandobritoiu commented on Apr 16, 2025 I've encountered the same issue but not with DropdownMenu.
Solution is to have a state for disable and add a TouchableOpacity around the entire DropdownMenu.
const [isLongPressActive, setIsLongPressActive] = useState(false)
const handlePress = useCallback(() => {
if (!isLongPressActive) {
[what you want it to do after normal press]
}
setTimeout(() => {
setIsLongPressActive(false)
}, 100)
}, [isLongPressActive, onPress, item])
const handleLongPress = useCallback(() => {
setIsLongPressActive(true)
}, [])
const handlePressOut = useCallback(() => {
setTimeout(() => {
setIsLongPressActive(false)
}, 100)
}, [])
<TouchableOpacity
onPress={handlePress}
onLongPress={handleLongPress}
onPressOut={handlePressOut}
delayLongPress={200}>
<Root>
<Content>
[...]
</Content>
<DropdownMenu.Trigger disabled={!isLongPressActive} action="longPress">
[button]
</DropdownMenu.Trigger>
</Root>
</TouchableOpacity>
Hope this helps. I've tried using gesture handler too but it didn't work as expected. Use a native Touchable or Pressable to wrap the entire menu.
This fixed my android issue of tapping the button and it still opened the menu for some reason (Exactly as your case shows in the video) smanzler commented on May 15, 2025 same issue, I am going to use the same workout around setting onLongPress to () => {} vladislav-gorovenko commented on Jul 17, 2025 hlog2e commented on Jan 7, 2026 Same here — I can reproduce this on my side too. The only way I’ve been able to make it work is by using a hack like onLongPress={() => {}} (no-op). It feels like the only practical workaround right now. Hoping there’s a real fix upstream. richardo2016 commented on Jan 7, 2026 This seems to be a type of problem I've solved before (although the performance isn't 100% identical, I believe the underlying cause is the same).
@ChristopherGabba I'd like to ask if this bounty is still valid? If it is, I can provide a PR and demo video (based on a real device, not a simulator) for the repository you provide. If you confirm it's valid, you can pay me the bounty via Apple gift card or crypto. mateofowlerz commented on Jan 12, 2026
This seems to be a type of problem I've solved before (although the performance isn't 100% identical, I believe the underlying cause is the same).
@ChristopherGabba I'd like to ask if this bounty is still valid? If it is, I can provide a PR and demo video (based on a real device, not a simulator) for the repository you provide. If you confirm it's valid, you can pay me the bounty via Apple gift card or crypto.
i'll pay u the bounty if the pr gets merged into Zeego. I hate this workaround richardo2016 commented on Jan 12, 2026
This seems to be a type of problem I've solved before (although the performance isn't 100% identical, I believe the underlying cause is the same).
@ChristopherGabba I'd like to ask if this bounty is still valid? If it is, I can provide a PR and demo video (based on a real device, not a simulator) for the repository you provide. If you confirm it's valid, you can pay me the bounty via Apple gift card or crypto.
i'll pay u the bounty if the pr gets merged into Zeego. I hate this workaround
Hi, maybe you don't need a pr merged into the zeego, you can use patch-package or yarn package to make your workaround available in your repository mateofowlerz commented on Jan 12, 2026 Sent you an email!
…
On Mon, Jan 12, 2026 at 11:40 AM Richard ***@***.***> wrote:
*richardo2016* left a comment ( nandorojo/zeego#145)
< #145 (comment)>
This seems to be a type of problem I've solved before (although the
performance isn't 100% identical, I believe the underlying cause is the
same).
@ChristopherGabba < https://github.com/ChristopherGabba> I'd like to ask
if this bounty is still valid? If it is, I can provide a PR and demo video
(based on a real device, not a simulator) for the repository you provide.
If you confirm it's valid, you can pay me the bounty via Apple gift card or
crypto.
i'll pay u the bounty if the pr gets merged into Zeego. I hate this
workaround
Hi, maybe you don't need a pr merged into the zeego, you can use
patch-package or yarn package to make your workaround available in your
repository
—
Reply to this email directly, view it on GitHub
< #145 (comment)>,
or unsubscribe
< https://github.com/notifications/unsubscribe-auth/AXNFJVQAGB5M3RDAW4U4A7T4GOW6FAVCNFSM6AAAAABYQBYMDSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOMZYHA4DAOBUG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Co-founder @ Sirvana | +543435135169
mateofowlerz commented on Jan 12, 2026 orgorin023 commented on Jun 16, 2026 Opened PR #196 with a native long-press trigger fix: https://github.com/nandorojo/zeego/pull/196\n\nIt wraps the trigger child press handler only for native long-press triggers so the trailing press after the context menu opens is swallowed once, while normal press behavior resumes afterwards.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|