Skip to content

fix(table): insert trailing and inter-table paragraph blocks to prevent desynced selection (#4956) - #5063

Closed
Samarth1306w wants to merge 4 commits into
udecode:mainfrom
Samarth1306w:fix/table-unmapped-dom-region-selection-desync-4956
Closed

fix(table): insert trailing and inter-table paragraph blocks to prevent desynced selection (#4956)#5063
Samarth1306w wants to merge 4 commits into
udecode:mainfrom
Samarth1306w:fix/table-unmapped-dom-region-selection-desync-4956

Conversation

@Samarth1306w

@Samarth1306w Samarth1306w commented Aug 4, 2026

Copy link
Copy Markdown
  • Auto release

Issue

Closes #4956

Summary

Fixes desynced selection and toSlateRange crash (Cannot resolve a Slate point from DOM point) when clicking in unmapped DOM gaps beside or between tables.

Changes

Updated withNormalizeTable.ts to normalize top-level table blocks:

  1. Automatically appends a trailing paragraph block if a table is at the end of the document.
  2. Automatically inserts an empty inter-table paragraph block between adjacent tables.

Acceptance criteria

  • Inserts trailing paragraph block for top-level tables at document end
  • Inserts inter-table paragraph block between adjacent tables
  • Prevents toSlateRange crashes on user typing/pasting in unmapped DOM gaps

/claim #4956

@codesandbox

codesandbox Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 65a9e51

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@platejs/table Patch
@platejs/core Patch
@platejs/csv Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. patch Bugfix & documentation PR plugin:table Tables labels Aug 4, 2026
@zbeyens zbeyens closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bugfix & documentation PR plugin:table Tables size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Table: clicks on unmapped DOM regions desync selection and crash toSlateRange on typing/paste

3 participants