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

Copy table bugfix #2768

Merged
merged 6 commits into from
Nov 27, 2023
Merged

Copy table bugfix #2768

merged 6 commits into from
Nov 27, 2023

Conversation

KorovinQuantori
Copy link
Contributor

Description

Bugfix for #2767

Copy link

changeset-bot bot commented Nov 27, 2023

🦋 Changeset detected

Latest commit: d1040bd

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

This PR includes changesets to release 4 packages
Name Type
@udecode/plate-table Patch
@udecode/plate Patch
@udecode/plate-serializer-csv Patch
@udecode/plate-serializer-docx 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

Copy link

vercel bot commented Nov 27, 2023

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

Name Status Preview Comments Updated (UTC)
plate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2023 0:29am

Copy link
Contributor

reviewpad bot commented Nov 27, 2023

Thank you @KorovinQuantori for this first contribution!

Copy link
Collaborator

@12joan 12joan left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Can you add a changeset and (if you don't mind, just because I'm curious) explain more about how the problem arises and why data.clearData() fixes it?

@12joan
Copy link
Collaborator

12joan commented Nov 27, 2023

Actually, I can still reproduce the bug on the Vercel deployment for this branch.

recording.mp4

@KorovinQuantori
Copy link
Contributor Author

Thanks for the PR! Can you add a changeset and (if you don't mind, just because I'm curious) explain more about how the problem arises and why data.clearData() fixes it?

Sure thing. The problem is described here: #2767. So, in general, lets say we have a row of 3 cells we want to copy. First cell is filled with "1", others are empty. In that case, on the first iteration of rowCells.forEach we'll set "1" in data buffer, but on the second and third we'll still get this "1" in buffer, because cells are empty. I suspect, it's either select section selects nothing, because the cell is empty or setFragmentData does nothing because we selected nothing.

BTW: I've updated PR, had a wrong insertion, when was copying it from my project. Could you tell me more about changeset and how to fill it properly?

@12joan
Copy link
Collaborator

12joan commented Nov 27, 2023

Thanks for the explanation, that makes sense.

To add the changeset, run yarn changeset add. Since this is a non-breaking bug fix, you can select patch, and then describe what changed from a behavioural perspective. A one-line description of the fixed issue would suffice. Merging a PR containing a changeset starts the process to deploy new versions of the affected Plate packages.

@KorovinQuantori
Copy link
Contributor Author

KorovinQuantori commented Nov 27, 2023

Thank you, added a changeset

@12joan 12joan enabled auto-merge November 27, 2023 12:13
@12joan 12joan merged commit 8d8b5fe into udecode:main Nov 27, 2023
6 checks passed
@zbeyens zbeyens mentioned this pull request Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Pull request is small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants