-
Notifications
You must be signed in to change notification settings - Fork 61
fix: correct cursor position when typing after fully track-deleted content #1828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: correct cursor position when typing after fully track-deleted content #1828
Conversation
…ntent When all content in a text node is track-deleted and the user types new text, characters were appearing in reverse order. This happened because: 1. Each new character was inserted after the deletion span (correct) 2. But the cursor was mapped back to the original position (incorrect) 3. So each subsequent character was also inserted at the same position The fix stores the actual insertion end position in transaction meta and uses it for cursor placement when content is inserted after a deletion span.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 811dbe59e0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
packages/super-editor/src/extensions/track-changes/trackChangesHelpers/replaceStep.js
Outdated
Show resolved
Hide resolved
harbournick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# [1.9.0-next.4](v1.9.0-next.3...v1.9.0-next.4) (2026-01-24) ### Bug Fixes * correct cursor position when typing after fully track-deleted content ([#1828](#1828)) ([8de1c5f](8de1c5f))
|
🎉 This PR is included in version 1.9.0-next.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
When all content in a text node is track-deleted and the user types new text, characters were appearing in reverse order. This happened because:
The fix stores the actual insertion end position in transaction meta and uses it for cursor placement when content is inserted after a deletion span.