lexical icon indicating copy to clipboard operation
lexical copied to clipboard

[lexical] Bug Fix(keydown): trigger copy command for non range selection

Open mrdivyansh opened this issue 1 year ago • 8 comments

Description

The copy and cut command isn't triggered when the selection is TableSelection type. Currently, the code checks for NodeSelection; however, it should have been supporting custom selection as well.

Closes #6438

Test plan

~~I have added an e2e test but the test passes even without my changes. I am not sure why I can't reproduce the bug by automated interaction but manual interaction. I am looking for help on this.~~ The added test works for Firefox.

Before

https://github.com/user-attachments/assets/4d6c10f1-7e68-488f-be9c-1b9b1899e0e7

After

https://github.com/user-attachments/assets/aa7844a6-2bd4-4dde-92b2-8c393c8771c5

mrdivyansh avatar Jul 22 '24 04:07 mrdivyansh

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 Aug 10, 2024 10:07am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 10, 2024 10:07am

vercel[bot] avatar Jul 22 '24 04:07 vercel[bot]

Hi @mrdivyansh!

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 [email protected]. Thanks!

facebook-github-bot avatar Jul 22 '24 04:07 facebook-github-bot

size-limit report 📦

Path Size
lexical - cjs 29.25 KB (0%)
lexical - esm 29.11 KB (0%)
@lexical/rich-text - cjs 37.66 KB (0%)
@lexical/rich-text - esm 30.9 KB (0%)
@lexical/plain-text - cjs 36.24 KB (0%)
@lexical/plain-text - esm 28.29 KB (0%)
@lexical/react - cjs 39.52 KB (0%)
@lexical/react - esm 32.39 KB (0%)

github-actions[bot] avatar Jul 22 '24 04:07 github-actions[bot]

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

facebook-github-bot avatar Jul 22 '24 05:07 facebook-github-bot

similar to the test, im unable to manually reproduce the issue described in https://github.com/facebook/lexical/issues/6438

https://github.com/user-attachments/assets/fba79ba7-90ad-4af3-85c1-21a4b6436882

followed the same steps listed in the issue

are u using any special setup locally?

potatowagon avatar Jul 24 '24 10:07 potatowagon

@potatowagon, you missed the 3rd step. I can see a paragraph node (409) before the table node (410) in your demo. You need to ensure there is no other nodes except a table node.

mrdivyansh avatar Jul 25 '24 13:07 mrdivyansh

ok i can repro the issue after including the third step

potatowagon avatar Jul 26 '24 04:07 potatowagon

None of the tests fail on my local machine. Added delays and assertions. It might help.

mrdivyansh avatar Aug 10 '24 10:08 mrdivyansh

Pretty sure that this was fixed in #6834

etrepum avatar Dec 16 '24 02:12 etrepum