Skip to content

Conversation

@JostSchenck
Copy link
Contributor

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.

@JostSchenck
Copy link
Contributor Author

Adding to this: The two failing tests are both unrelated.
@matthew-carroll @angelosilvestre If there is anything else I can do to make this acceptable, I'd be happy to do so -- the bug is pretty annoying for the user, at least on all desktop platforms.

Copy link
Collaborator

@angelosilvestre angelosilvestre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @JostSchenck. Thanks for the PR. I left a few comments.

@JostSchenck JostSchenck force-pushed the fix/issue-2593-cursor-resets-to-end-of-paragraph-after-paste branch 2 times, most recently from 6b60d64 to 040233c Compare November 5, 2025 20:43
…mple text (without newlines) in the middle of a paragraph
…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
@JostSchenck JostSchenck force-pushed the fix/issue-2593-cursor-resets-to-end-of-paragraph-after-paste branch from 6443707 to b375f3b Compare November 19, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - Cursor Resets to End of Paragraph After Pasting Text in Middle of Paragraph

3 participants