Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3725723
D5794.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5794.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5794: [native] Prevent text from being highlighted on press when if is no pressable
Attached
Detach File
Event Timeline
Log In to Comment