Skip to content

Conversation

@caio-pizzol
Copy link
Contributor

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.

…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.
@linear
Copy link

linear bot commented Jan 24, 2026

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Copy link
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

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

LGTM

@harbournick harbournick merged commit 8de1c5f into main Jan 24, 2026
4 of 5 checks passed
@harbournick harbournick deleted the caio/sd-1624-fix-cursor-position-after-typing-in-fully-track-deleted branch January 24, 2026 16:03
harbournick pushed a commit that referenced this pull request Jan 24, 2026
# [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))
@harbournick
Copy link
Collaborator

🎉 This PR is included in version 1.9.0-next.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Text typed in reverse order in Suggesting Mode when all content is track-deleted

3 participants