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
[lexical-y] Bug: An emptied non-simple text node and root NodeState stay in the editing client only #9789
@lexical/y does not store some node state an editor shows, so the editing client keeps it while every other client and a fresh read of the document do not. Found by review of the binding; both reproduce with ordinary local edits on main.
1. An emptied text node that is not simple text.setTextContent('') on a token or segmented TextNode, a TextNode subclass, or a CodeHighlightNode leaves the editor with an empty node (its class, mode, format, style and any NodeState). Lexical's normalization removes only empty simple text nodes, and the binding writes text as runs of characters, which an empty node has none of: the node is never stored, nothing reads it back, and no warning is raised. Peers and a fresh reader have no node there.
editor.update(()=>{consttoken=$getRoot().getLastChildOrThrow().getFirstChildOrThrow();// a token TextNodetoken.setTextContent('');$setState(token,someState,'value');});// this editor: paragraph(token "" with someState); peers and a fresh reader: paragraph()
2. NodeState on the root.$setState($getRoot(), state, value) stays in the editor that set it: the binding stores the root's children, not its own fields or NodeState. Lexical documents root NodeState as document metadata.
Expected: either the binding stores these, or it reads them back on the editing client after writing, so that no client keeps state the document does not have. Cells pinning both as test.fails will reference this issue.
Activity
[lexical-y] Chore: Pin #9789, node state the binding does not store, …
[lexical-y][lexical-website] Bug Fix: Read back what a local update l…
[lexical-y][lexical-website] Bug Fix: Read back what a local update l…
[lexical-y][lexical-website] Bug Fix: Read back what a local update l…