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
Pasting a table into a table cell isn't nested #528
Pasting a table while the caret is inside a table cell does not nest the
table into that cell. The pasted table does not appear in the clicked cell —
the paste has no visible effect.
Creating a nested table with the Insert Table command works correctly (the
new table nests inside the cell) — only the paste path is affected. So the
in-cell nesting capability exists; paste just doesn't use it.
What you expected to happen:
Pasting a table into a table cell should nest it into that cell, matching:
what the Insert Table command already does when the caret is inside a cell, and
Google Docs / Word behavior.
The pasted table should appear inside the clicked cell, with the caret landing
in the first cell of the pasted table.
How to reproduce it (as minimally and precisely as possible):
Somewhere else, insert another table, select it, and copy it (Cmd + C)
Click into a cell of the outer table (caret is now inside the cell)
Paste (Cmd + V)
Expected: the copied table nests inside the clicked cell
Actual: nothing happens — the table is not inserted into the cell
Anything else we need to know?:
Localized to the paste path. insertBlocks in packages/docs/src/view/text-editor.ts handles a single pasted table block
with the body-onlygetBlockIndex + insertBlockAt. These don't account
for the caret being inside a cell — EditContext is only 'body' | 'header' | 'footer' (no cell context), and getContextBlocks()
returns only body/header/footer blocks. So a cell target isn't resolved and
the table isn't inserted into the cell.
By contrast, the insertTable command already detects the cell via layout.blockParentMap and routes to insertTableInCell, so nesting works
there. The fix is to apply the same cell detection in the paste path
(insertBlocks).
changed the title [-]Pasting a table into a table cell isn't nested — it lands in the document body[/-][+]Pasting a table into a table cell isn't nested[/+]on Jul 23, 2026
Activity
[-]Pasting a table into a table cell isn't nested — it lands in the document body[/-][+]Pasting a table into a table cell isn't nested[/+]Nest a pasted table into the table cell the caret is in
Nest a pasted table into the table cell the caret is in (issue #528) (#…
Address CodeRabbit review on the paste-into-cell design note
Fix wafflebase#333: recursively regenerate ids for pasted nested tables
Extend paste-into-cell design note to cover #333 (#597)