We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c37ff42 + 9e07fb2 commit 75e79e6Copy full SHA for 75e79e6
ts/components/conversation/message/message-content/MessageContextMenu.tsx
@@ -216,7 +216,10 @@ export const MessageContextMenu = (props: Props) => {
216
}, [isSelectedBlocked, messageId]);
217
218
const copyText = useCallback(() => {
219
- MessageInteraction.copyBodyToClipboard(text);
+ const selection = window.getSelection();
220
+ const selectedText = selection?.toString().trim();
221
+ // Note: we want to allow to copy through the "Copy" menu item the currently selected text, if any.
222
+ MessageInteraction.copyBodyToClipboard(selectedText || text);
223
}, [text]);
224
225
const onSelect = useCallback(() => {
0 commit comments