fix(mobile): handle Android swipes inside native menu hosts

This commit is contained in:
joshuafhiggins committed 2026-11-15 17:31:35 -05:00 Verified
1 parent 6d554cd30c
commit c8a6df454d
1 file changed
+15 -4
+15 -4
View File
@@ -11,7 +11,11 @@ import {
} from "@expo/ui/jetpack-compose"
import { useState } from "react"
import { Pressable, View } from "react-native"
import { Gesture, GestureDetector } from "react-native-gesture-handler"
import {
Gesture,
GestureDetector,
GestureHandlerRootView,
} from "react-native-gesture-handler"
import { appleMusic } from "@/lib/theme"
@@ -75,9 +79,16 @@ export function MenuView({
matchContents={shouldOpenOnLongPress ? { vertical: true } : true}
>
{shouldOpenOnLongPress ? (
<GestureDetector gesture={longPress}>
<View collapsable={false}>{children}</View>
</GestureDetector>
// Compose hosts the RN subtree across a native touch boundary.
// Keep its menu and row gestures under a root inside that boundary.
<GestureHandlerRootView
unstable_forceActive
style={{ alignSelf: "stretch" }}
>
<GestureDetector gesture={longPress}>
<View collapsable={false}>{children}</View>
</GestureDetector>
</GestureHandlerRootView>
) : (
<Pressable
onPress={() => setExpanded(true)}