Fix/issue 2593 cursor resets to end of paragraph after paste#2814
Open
JostSchenck wants to merge 4 commits intoFlutter-Bounty-Hunters:mainfrom
Open
Conversation
Contributor
Author
|
Adding to this: The two failing tests are both unrelated. |
angelosilvestre
requested changes
Nov 4, 2025
Collaborator
angelosilvestre
left a comment
There was a problem hiding this comment.
Hey @JostSchenck. Thanks for the PR. I left a few comments.
6b60d64 to
040233c
Compare
…mple text (without newlines) in the middle of a paragraph
…ulting in correct selection
…ds correctly placed selection when a) text spanning a single text node is pasted inside a node or at the end of a node, b) text spanning several text nodes is pasted inside a node or at the end of a node. Added test for behavior with multiple nodes. Renamed documentPositionAfterPast > selectionAfterPaste
6443707 to
b375f3b
Compare
Contributor
Author
|
@matthew-carroll @angelosilvestre I would be glad if you could take a look over this again |
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.
This fixes #2593 . Currently, the code silently assumes that when text is pasted, it covers complete nodes, and always places the caret at the end. However, when only some text without paragraphs is pasted into the middle of a paragraph, the user expects the caret to be placed at the end of the inserted text.