Skip to content

[lexical-table] Bug Fix: Handle accessing table selection following table deletion#7864

Merged
etrepum merged 2 commits intofacebook:mainfrom
patrick-atticus:table-selection-getnodes-guard
Sep 25, 2025
Merged

[lexical-table] Bug Fix: Handle accessing table selection following table deletion#7864
etrepum merged 2 commits intofacebook:mainfrom
patrick-atticus:table-selection-getnodes-guard

Conversation

@patrick-atticus
Copy link
Copy Markdown
Contributor

Description

If you have a table selection, delete the table, then access that selection immediately afterwards (eg selection.getNode()), and error is thrown ("node not found"). This can occur via an update listener as shown in #7140

It is also common in collab scenarios where one client has a table selection and another client deletes the selected rows.

I have reproduced the error in a unit test, and fixed it by adding extra checks in getNodes to detect the invalid selection.

fixes #7140

Test plan

Added unit text reproducing the error Error: Point.getNode: node not found

Test passes with code fix

@vercel
Copy link
Copy Markdown

vercel bot commented Sep 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
lexical Ready Ready Preview Comment Sep 25, 2025 5:53am
lexical-playground Ready Ready Preview Comment Sep 25, 2025 5:53am

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 25, 2025
@etrepum etrepum added this pull request to the merge queue Sep 25, 2025
Merged via the queue into facebook:main with commit e5d9556 Sep 25, 2025
40 checks passed
@etrepum etrepum mentioned this pull request Oct 1, 2025
ayoubjemai pushed a commit to masar-edu/masar-doc-editor that referenced this pull request Feb 7, 2026
ayoubjemai pushed a commit to masar-edu/masar-doc-editor that referenced this pull request Feb 7, 2026
ayoubjemai pushed a commit to masar-edu/masar-doc-editor that referenced this pull request Feb 7, 2026
ayoubjemai pushed a commit to masar-edu/masar-doc-editor that referenced this pull request Feb 7, 2026
ayoubjemai pushed a commit to masar-edu/masar-doc-editor that referenced this pull request Feb 7, 2026
ayoubjemai pushed a commit to masar-edu/masar-doc-editor that referenced this pull request Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: selection points to missing nodes after calling $deleteTableRow__EXPERIMENTAL() on all table rows

2 participants