You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: [lexical-y] The caret is put back in the wrong place after several unread changes overlapping a local delete are read #9829
@lexical/y: when several remote changes are read together after a local delete that overlaps them, the binding can put the caret back in the wrong place (the content is right).
Example: the line abcdefghijklmnopqrst, caret after n. In one update, A deletes [4,9) and a provider applies B's change (deletes [7,12)) and C's change (deletes [2,5)). After the changes are read, A's text is abmnopqrst (correct), but the caret is at 7 instead of 4 (after n). With gc on, a variant puts it at 2.
The same class as #9825: the binding's view of what it has not read yet classifies whole Yjs items by their first id, and Yjs merges adjacent deleted items again at the end of each transaction. The writes and $resolveCursor now split items at the view's bounds first (#9826); the selection restore inside a read ($restoreSelection / $resolvePosition while other changes are still unread) does not yet. A single remote change maps correctly.
Hi, I'd like to work on this issue. Could you please assign it to me?
I'll investigate the caret restoration issue in @lexical/y when multiple remote Yjs changes overlap with a local deletion, identify the root cause, and work on a fix.
Activity
Sufiyan-MSA commentedon Nov 15, 2026
Hi, I'd like to work on this issue. Could you please assign it to me?
I'll investigate the caret restoration issue in @lexical/y when multiple remote Yjs changes overlap with a local deletion, identify the root cause, and work on a fix.