Skip to content

Commit 7b8ad70

Browse files
shivamhwpclaude
andcommitted
fix(mobile): TalkBack can open file text selection from a row
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent e20df26 commit 7b8ad70

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎apps/mobile/src/features/files/SourceFileSurface.tsx‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,20 @@ const HighlightedSourceLine = function HighlightedSourceLine(props: {
135135
</NativeText>
136136
</View>
137137
);
138-
return props.onLongPress ? <Pressable onLongPress={props.onLongPress}>{row}</Pressable> : row;
138+
const onLongPress = props.onLongPress;
139+
return onLongPress ? (
140+
<Pressable
141+
onLongPress={onLongPress}
142+
accessibilityActions={[{ name: "longpress", label: "Select text" }]}
143+
onAccessibilityAction={(event) => {
144+
if (event.nativeEvent.actionName === "longpress") onLongPress();
145+
}}
146+
>
147+
{row}
148+
</Pressable>
149+
) : (
150+
row
151+
);
139152
};
140153

141154
function useSourceFileModel(props: SourceFileSurfaceProps) {

0 commit comments

Comments
 (0)