Skip to content

[lexical-table] Bug Fix: table cell background copy paste not working #7232

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jvithlani
Copy link
Contributor

@jvithlani jvithlani commented Feb 22, 2025

Description

While copy pasting a table cell with background color, the background color doesn't carry forward with the table details

Test plan

Before

Screen.Recording.2025-02-22.at.2.47.52.PM.mov

After

Screen.Recording.2025-02-22.at.2.48.56.PM.mov

Insert relevant screenshots/recordings/automated-tests

Copy link

vercel bot commented Feb 22, 2025

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 May 22, 2025 6:50am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2025 6:50am

@facebook-github-bot
Copy link
Contributor

Hi @jvithlani!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

ivailop7
ivailop7 previously approved these changes Feb 22, 2025
@etrepum
Copy link
Collaborator

etrepum commented Feb 22, 2025

You'll need to sign the CLA before we can run the tests and possibly merge this PR

@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 Feb 22, 2025
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@etrepum
Copy link
Collaborator

etrepum commented Feb 24, 2025

It doesn't look like this change passes the existing e2e test suite (possibly because the tests should change to accommodate this new behavior), and there are no new tests that verify that it works now. Further work will have to be done here before it can be merged.

@ivailop7
Copy link
Collaborator

ivailop7 commented Mar 2, 2025

@jvithlani are you planning on finishing this one?

@jvithlani
Copy link
Contributor Author

jvithlani commented Mar 3, 2025

Hey @ivailop7, yes ill wrap this up, was a little caught up. Will finish it this week

@jvithlani
Copy link
Contributor Author

@ivailop7 @etrepum i see unrelated tests failing, which are working fine on local, can you guys help me fix it

@etrepum
Copy link
Collaborator

etrepum commented Mar 4, 2025

Doesn’t look unrelated? This is the failing test

[chromium] › packages/lexical-playground/tests/e2e/CopyAndPaste/html/TablesHTMLCopyAndPaste.spec.mjs:351:3 › HTML Tables CopyAndPaste › Copy + paste - Merge Grids

@jvithlani
Copy link
Contributor Author

@etrepum i need some help here, i had left this as it looked like a longer debug.
I went through the flow, as im trying to mutate the node by setting the background color, a new dom element is being created and replaced, which doesnt have the TableCellSelected class. This was working fine till now as no properties are being imported on pasting.

My concern here is although the table is still selected in the lexical's selection, why didnt the tableObserver update the classes of the new DOM created in the tableCell, i also tried adding a
$updateDOMForSelection(editor, tableObserver.getTable(), selection);
but this also doesnt help, any help would be much appreciated

@jvithlani
Copy link
Contributor Author

@etrepum tiny bump here

@ivailop7
Copy link
Collaborator

ivailop7 commented May 26, 2025

@jvithlani the tests are still failing.

Edit: Nevermind, I see Bob has commented on this already.

@jvithlani
Copy link
Contributor Author

@ivailop7 waiting for Bob's reply

@etrepum
Copy link
Collaborator

etrepum commented May 26, 2025

I probably won’t have time to look into this for a few days, this level of question is basically asking me to fix it. It’s a long holiday weekend in the US.

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. extended-tests Run extended e2e tests on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants