Page MenuHomePhabricator

D5794.diff
No OneTemporary

D5794.diff

diff --git a/native/markdown/markdown-paragraph.react.js b/native/markdown/markdown-paragraph.react.js
--- a/native/markdown/markdown-paragraph.react.js
+++ b/native/markdown/markdown-paragraph.react.js
@@ -4,6 +4,7 @@
import { Text } from 'react-native';
import { MessagePressResponderContext } from '../chat/message-press-responder-context';
+import { TextMessageMarkdownContext } from '../chat/text-message-markdown-context';
import type { TextStyle } from '../types/styles';
type Props = {
@@ -11,10 +12,20 @@
+children: React.Node,
};
function MarkdownParagraph(props: Props): React.Node {
+ const textMessageMarkdownContext = React.useContext(
+ TextMessageMarkdownContext,
+ );
+
const messagePressResponderContext = React.useContext(
MessagePressResponderContext,
);
- const onPressMessage = messagePressResponderContext?.onPressMessage;
+
+ // We only want to define the onPress handler if the message
+ // has any kind of pressable in it
+ const onPressMessage = textMessageMarkdownContext?.markdownHasPressable
+ ? messagePressResponderContext?.onPressMessage
+ : null;
+
return (
<Text
style={props.style}

File Metadata

Mime Type
text/plain
Expires
Thu, Jan 9, 7:05 PM (11 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2838347
Default Alt Text
D5794.diff (1 KB)

Event Timeline