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-table] A node inserted while a ragged table selection ends on a row with only a hole is lost #9756
With #9749, a table selection whose last row has only a hole and cells spanning from above within the selection (a ragged table) returns that row's TableRowNode as the last node of getNodes(). $insertNodeToNearestRoot (@lexical/utils) starts from the last selected node, so a node inserted while such a selection is active (an image, a horizontal rule) never reaches the document. Before #9749 the same selection threw in getNodes(), so the insert was lost there too, with an error.
Reproduction
Rows ['OUT', A (rowSpan 2), 'B'] and ['OUT2'] (a ragged table, as concurrent row and column inserts leave it, the table transform not run); a table selection from A to B; then $insertNodeToNearestRoot($createHorizontalRuleNode()) (or any block insert that uses it): the node is not in the editor state afterwards.
Direction
Either $insertNodeToNearestRoot should take the focus cell (or the last cell) of a table selection rather than its last node, or getNodes() should not end on a row node. The trailing row is kept on purpose: a copy of the selection needs it, so that a pasted row span is not cut short.
Activity
[lexical-utils][lexical-table] Bug Fix: Insert blocks into focus cells
[lexical-utils][lexical-table] Bug Fix: Insert blocks into focus cells