@devries-cameron20 / t3code Mirror · read-only / commits / 23a5c774ee
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 05:30 UTC

fix(android): menu icons take taps (#20802)

Co-authored-by: Pixel Perfect <me@pixp.cc> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>

Julius Marminge committed Oct 17, 2026 at 00:05 UTC 23a5c774ee375e4d5cccdfc554150790d8decd94
1 file changed +23 -6
apps/mobile/src/components/ui/MenuPopup.android.tsx
+23 -6
@@ -8,7 +8,7 @@ import {
8 Text,
9 } from "@expo/ui/jetpack-compose";
10 import { defaultMinSize, padding, size, width } from "@expo/ui/jetpack-compose/modifiers";
11 -import { View } from "react-native";
11 +import { Pressable } from "react-native";
12 import { resolveScaledTextRole } from "../../lib/appearancePreferences";
13
14 import { useAndroidControlSizing } from "./useAndroidControlSizing";
@@ -16,15 +16,23 @@ import { useAppearancePreferences } from "../../features/settings/appearance/App
16 import type { MenuPopupProps } from "./MenuPopup";
17 import { isAppSymbolName, SymbolView, type AppSymbolName } from "./AppSymbol";
18
19 +// The glyph is a React Native view hosted in the Compose row, and its native host consumes
20 +// every touch over it, so the row's onClick never sees a tap on the icon. The glyph runs the
21 +// row's action itself; the row stays the accessible element.
22 function MenuIcon(props: {
23 readonly name: AppSymbolName;
24 + readonly onPress: () => void;
25 readonly destructive?: boolean;
26 readonly disabled?: boolean;
27 }) {
28 const { iconSize } = useAndroidControlSizing();
29 return (
30 <RNHostView matchContents modifiers={[size(iconSize, iconSize)]}>
27 - <View
31 + <Pressable
32 + accessible={false}
33 + focusable={false}
34 + disabled={props.disabled}
35 + onPress={props.onPress}
36 style={{ width: iconSize, height: iconSize }}
37 importantForAccessibility="no-hide-descendants"
38 >
@@ -40,7 +48,7 @@ function MenuIcon(props: {
48 : "accent-foreground"
49 }
50 />
43 - </View>
51 + </Pressable>
52 </RNHostView>
53 );
54 }
@@ -60,7 +68,7 @@ export function MenuPopup(props: MenuPopupProps) {
68 {props.parent ? (
69 <DropdownMenuItem onClick={props.onBack} modifiers={itemModifiers}>
70 <DropdownMenuItem.LeadingIcon>
63 - <MenuIcon name="arrow.left" />
71 + <MenuIcon name="arrow.left" onPress={props.onBack} />
72 </DropdownMenuItem.LeadingIcon>
73 <DropdownMenuItem.Text>
74 <Text color={foreground} style={{ typography: "bodyLarge", ...body }}>
@@ -88,6 +96,7 @@ export function MenuPopup(props: MenuPopupProps) {
96 <DropdownMenuItem.LeadingIcon>
97 <MenuIcon
98 name={action.image}
99 + onPress={() => props.onPress(action)}
100 destructive={action.attributes?.destructive}
101 disabled={action.attributes?.disabled}
102 />
@@ -116,11 +125,19 @@ export function MenuPopup(props: MenuPopupProps) {
125 </DropdownMenuItem.Text>
126 {(action.subactions?.length ?? 0) > 0 ? (
127 <DropdownMenuItem.TrailingIcon>
119 - <MenuIcon name="chevron.right" disabled={action.attributes?.disabled} />
128 + <MenuIcon
129 + name="chevron.right"
130 + onPress={() => props.onPress(action)}
131 + disabled={action.attributes?.disabled}
132 + />
133 </DropdownMenuItem.TrailingIcon>
134 ) : action.state === "on" ? (
135 <DropdownMenuItem.TrailingIcon>
123 - <MenuIcon name="checkmark" disabled={action.attributes?.disabled} />
136 + <MenuIcon
137 + name="checkmark"
138 + onPress={() => props.onPress(action)}
139 + disabled={action.attributes?.disabled}
140 + />
141 </DropdownMenuItem.TrailingIcon>
142 ) : null}
143 </DropdownMenuItem>