diff --git a/gui/src/components/StyledMarkdownPreview/SyntaxHighlightedPre.tsx b/gui/src/components/StyledMarkdownPreview/SyntaxHighlightedPre.tsx index 6e4fc3e2be5..527252d74c0 100644 --- a/gui/src/components/StyledMarkdownPreview/SyntaxHighlightedPre.tsx +++ b/gui/src/components/StyledMarkdownPreview/SyntaxHighlightedPre.tsx @@ -26,6 +26,11 @@ const StyledPre = styled.pre<{ theme: any }>` max-height: 40vh; overflow-y: scroll !important; + /* Keep code text selectable so a partial selection isn't lost when the + cursor leaves the code block while dragging (see issue #3850). */ + user-select: text; + -webkit-user-select: text; + ${(props) => generateThemeStyles(props.theme)} `;