-
Notifications
You must be signed in to change notification settings - Fork 43
fix: preserve style on row insertion #1553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix: preserve style on row insertion #1553
Conversation
|
@caio-pizzol can you please test that this version of SD would work while being used in SuperDoc Services? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| for (let i = 0; i < insertIndex; i++) { | ||
| insertPos += tableNode.child(i).nodeSize; | ||
| } | ||
|
|
||
| tr.insert(insertPos, newRow); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handle rowspans when inserting rows
The new insertRowAtIndex path just clones the source row and inserts it at the computed position without running the prosemirror-tables row insertion logic that splits or adjusts cells spanning multiple rows. If the table contains any rowspan > 1 cells around the insertion point (e.g., a merged cell above or below the cursor), those spans are left intact while the cloned row reuses the same rowspan attrs, causing overlapping cells and an invalid TableMap when the document is next read. The previous originalAddRowBefore/After implementations handled rowspans; this change regresses merged-row tables.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
harbournick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls check cases with v or h merged cells
84f8ea5 to
2a443d8
Compare


No description provided.