fix(gui): preserve text selection in code blocks on mouse leave#12622
Open
Nish2005karsh wants to merge 1 commit into
Open
fix(gui): preserve text selection in code blocks on mouse leave#12622Nish2005karsh wants to merge 1 commit into
Nish2005karsh wants to merge 1 commit into
Conversation
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Closes continuedev#3850 Problem: Text selected within a chat code block is lost as soon as the cursor leaves the code block while dragging, making it hard to copy a portion of generated code. Root cause: The rendered code block element (StyledPre in gui/src/components/StyledMarkdownPreview/SyntaxHighlightedPre.tsx) had no explicit user-select rule. With the scrollable, fixed-max-height <pre>, a partial drag-selection could be dropped when the cursor moved outside the element's bounds. Fix: Explicitly mark the <pre> as user-select: text (with -webkit- prefix) so selections persist regardless of where the cursor moves. Minimal, CSS-only change scoped to the chat code block. No behavior change for copy buttons or apply actions.
e50a5c7 to
e4b45f1
Compare
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3850
Problem
Text selected within a chat code block is lost as soon as the cursor leaves the code block while dragging, making it hard to copy a portion of generated code.
Root cause
The rendered code block element (
StyledPreingui/src/components/StyledMarkdownPreview/SyntaxHighlightedPre.tsx) had no explicituser-selectrule. With the scrollable, fixed-max-height<pre>, a partial drag-selection could be dropped when the cursor moved outside the element's bounds.Fix
Explicitly mark the
<pre>asuser-select: text(with-webkit-prefix) so selections persist regardless of where the cursor moves.Minimal, CSS-only change scoped to the chat code block. No behavior change for copy buttons or apply actions.