Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(android): menu icons take taps #20802

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/20802/headmerged by juliusmarminge View on GitHub

Showing 1 changed file with 23 additions and 6 deletions.

x
0 of 1 viewed, 1 left
23 additions and 6 deletionsapps/mobile/src/components/ui/MenuPopup.android.tsxModified
View file
@@ -8,7 +8,7 @@
Text,
} from "@expo/ui/jetpack-compose";
import { defaultMinSize, padding, size, width } from "@expo/ui/jetpack-compose/modifiers";
-import { View } from "react-native";
+import { Pressable } from "react-native";
import { resolveScaledTextRole } from "../../lib/appearancePreferences";
​
import { useAndroidControlSizing } from "./useAndroidControlSizing";
@@ -16,15 +16,23 @@
import type { MenuPopupProps } from "./MenuPopup";
import { isAppSymbolName, SymbolView, type AppSymbolName } from "./AppSymbol";
​
+// The glyph is a React Native view hosted in the Compose row, and its native host consumes
+// every touch over it, so the row's onClick never sees a tap on the icon. The glyph runs the
+// row's action itself; the row stays the accessible element.
function MenuIcon(props: {
readonly name: AppSymbolName;
+ readonly onPress: () => void;
readonly destructive?: boolean;
readonly disabled?: boolean;
}) {
const { iconSize } = useAndroidControlSizing();
return (
<RNHostView matchContents modifiers={[size(iconSize, iconSize)]}>
- <View
+ <Pressable
+ accessible={false}
+ focusable={false}