Native menus on Android — a trigger child with a press handler keeps the touch from the adapter, and `onLongPress` never fires inside a native menu
tamagui / @tamagui/web / @tamagui/native / @tamagui/menu 2.7.7, @expo/ui 57.0.19 (setup-expo-ui-menu / createExpoUIMenuAdapter), React Native 0.86 (Fabric), react-native-gesture-handler set up through @tamagui/native/setup-gesture-handler, Android 17 emulator.
Repro: <Menu><Menu.Trigger asChild><Button onPressIn={() => {}}>Open</Button></Menu.Trigger>…</Menu>. Any Tamagui element with onPress, onPressIn, onPressOut or onLongPress behaves the same.
- Expected: a tap opens the menu, as on iOS.
- Actual, on Android, nothing opens. The same trigger without press handlers (pressStyle only) opens.
- With
ContextMenu.Triggeraround such an element, a long press never opens the menu. The element'sonPressfires on release whatever the hold time.
Cause, as read in the source:
@expo/ui's AndroidMenuViewopens from its ownPressablearound the trigger (accessible={false}), withonPressoronLongPress.- Inside a native menu (
NativeMenuContext),useEventsgives an element with real press events aGesture.Manualthat callsonPressInon touch-down andonPress+onPressOuton touch-up.onLongPressis stored incallbacksRefand never called. wrapWithGestureDetectorthen addsonStartShouldSetResponder: () => trueon Fabric (hasRealPressEvents). The element becomes the responder, and the adapter'sPressablenever sees the touch.
Possible directions:
- Do not claim the responder when
isInsideNativeMenu. - Or have the native
Menu.Triggercompose the adapter's open into the child's press (tap) or into a timed hold (long press) when the child has its own handlers. - Call
onLongPressafterdelayLongPressin the Manual path.
Downstream workaround: a context from the adapter's MenuView that the trigger child calls (show() on press, or after a 500 ms hold with the release swallowed).
The same code is on main: code/core/web/src/eventHandling.native.ts last changed in 25561c4c2 (2026-07-03, the #4024 fix), before v2.7.7.
Source: tamagui/tamagui