diff --git a/components/Chat/Message/Message.tsx b/components/Chat/Message/Message.tsx index 2430e376a..1f115dfde 100644 --- a/components/Chat/Message/Message.tsx +++ b/components/Chat/Message/Message.tsx @@ -79,6 +79,20 @@ type Props = { isFrame: boolean; }; +// On iOS, the native context menu view handles the long press, but could potentially trigger the onPress event +// So we have to set a noop on long press on iOS so it doens't also trigger the onPress event +const platformTouchableLongPressDelay = Platform.select({ + ios: 100, + default: undefined, +}); + +const noop = () => {}; + +const platformTouchableOnLongPress = Platform.select({ + ios: noop, + default: undefined, +}); + const MessageSender = ({ message }: { message: MessageToDisplay }) => { const address = useInboxIdStore( (s) => s.byInboxId[message.senderAddress]?.[0] ?? message.senderAddress @@ -327,6 +341,8 @@ function ChatMessage({ message, colorScheme, isGroup, isFrame }: Props) { styles.innerBubble, message.fromMe ? styles.innerBubbleMe : undefined, ]} + delayLongPress={platformTouchableLongPressDelay} + onLongPress={platformTouchableOnLongPress} delayPressIn={isDesktop ? 0 : 75} onPress={() => { converseEventEmitter.emit("scrollChatToMessage", { @@ -395,6 +411,8 @@ function ChatMessage({ message, colorScheme, isGroup, isFrame }: Props) { {isFrame && ( handleUrlPress(message.content)} + delayLongPress={platformTouchableLongPressDelay} + onLongPress={platformTouchableOnLongPress} > {getUrlToRender(message.content)}