Skip to content
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

[lexical-table] Fix: Delete table row in merge cells #6922

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

iamvinayvk
Copy link
Contributor

Description

Describe the changes in this pull request
When deleting the table row for the merged cells the calculation of the actual row span for the cells was incorrect due to which extra columns were being created. Fixed the rowSpan calculation for the merged cells by taking the minimum value of the anchorCell.__rowSpan and the difference of overflow of top rows and current cell rowSpan.

Closes #5854

Test plan

Before

Insert relevant screenshots/recordings/automated-tests

Recording.2024-12-09.040342.1.mp4

After

Insert relevant screenshots/recordings/automated-tests

Recording.2024-12-09.040633.1.mp4

Copy link

vercel bot commented Dec 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 4:02pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 10, 2024 4:02pm

@facebook-github-bot facebook-github-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 Dec 8, 2024
Copy link

github-actions bot commented Dec 8, 2024

size-limit report 📦

Path Size
lexical - cjs 31.15 KB (0%)
lexical - esm 30.95 KB (0%)
@lexical/rich-text - cjs 40.1 KB (0%)
@lexical/rich-text - esm 32.81 KB (0%)
@lexical/plain-text - cjs 38.73 KB (0%)
@lexical/plain-text - esm 30.14 KB (0%)
@lexical/react - cjs 41.99 KB (0%)
@lexical/react - esm 34.17 KB (0%)

Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost as important as the fix itself is writing at least one test to show that this works as expected, and the test will ensure that it continues to work as the code evolves

@etrepum
Copy link
Collaborator

etrepum commented Dec 8, 2024

I don't think this fix is sufficient

Take for example this PR playground url, if you delete the row from the cell marked 'x' then it will deform the table

delete-row-bug.mov

@iamvinayvk
Copy link
Contributor Author

@etrepum I have handled the above case and also added two tests for the row deletion

previous-merged-cell.mp4

@iamvinayvk iamvinayvk requested a review from etrepum December 10, 2024 16:00
@etrepum etrepum added this pull request to the merge queue Dec 11, 2024
Merged via the queue into facebook:main with commit 28c33d6 Dec 11, 2024
39 of 40 checks passed
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: Delete a row in the table Delete
3 participants