[lexical-table] Bug Fix: Prevent nested table paste when hasNestedTables is false and merge fails#8440
Draft
matingathani wants to merge 4 commits into
Draft
[lexical-table] Bug Fix: Prevent nested table paste when hasNestedTables is false and merge fails#8440matingathani wants to merge 4 commits into
matingathani wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
reviewed
May 1, 2026
d5a4c72 to
8a89439
Compare
…Tables is false and fails
8a89439 to
60c234d
Compare
Author
|
@etrepum Branch has been rebased on If you had specific feedback in mind from your earlier review, I'm happy to address it. Let me know if there are edge cases you'd like covered or changes needed. |
etrepum
requested changes
May 3, 2026
Collaborator
etrepum
left a comment
There was a problem hiding this comment.
This test passes without your change, so either your change doesn't fix anything or the test isn't written correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When pasting a single table into a multi-cell table selection, if
$insertTableIntoGridfails to merge the pasted table into the destination grid, the command handler would returnfalse, allowing$insertGeneratedNodesto fall back to standard insertion which created a nested table even whenhasNestedTables: false.This PR ensures the paste is always handled (rejected with silent no-op) when the table merge fails and nested tables are not enabled.
Closes #8077
Test plan
Before
Pasting a table into a multi-cell selection could create a nested table when
hasNestedTableswas false.After
Pasting a table into a multi-cell selection is always rejected when
hasNestedTablesis false. The merge is attempted, and if it fails the paste is silently dropped rather than creating a nested table.