[lexical-clipboard] Preventing copying empty string#7880
[lexical-clipboard] Preventing copying empty string#7880etrepum merged 20 commits intofacebook:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
left a comment
There was a problem hiding this comment.
This looks like the right approach, if combined with the code that already checks the selection. It would be very nice to have a test that shows that this works
etrepum
left a comment
There was a problem hiding this comment.
This looks good assuming the existing tests pass, but the one thing it's missing is a test to show that it works since no existing test expects this new behavior.
|
Yes, i'm working on writing tests for this new behaviour |
|
@etrepum });` i was writing this, but this required write permission, should I add the write permission here in the respective file. |
|
You can select something on the page and copy it which wouldn't require write permission. This works in more browsers so it's a better test. |
|
We want to implement no-copying behavior only when selecting an empty string. |
|
Yes. Select something, copy it. Now the clipboard has something. Then collapse the selection and copy again. Confirm that the clipboard still has the original content. |
|
Another sequence would be:
|
|
Sure, Thank you |
|
@etrepum can you please see why these tests are failing |
|
The tests are failing in webkit and firefox because you wrote them in a way that only works in chromium. It's failing at Can be reproduced locally as well, here's how you would run that test directly (with Current output: I've just pushed a commit that fixes the test to work correctly without using any chrome specific code |
|
Yes, it's working now |
Description
Closes #7862
Test plan
Before
before.1.mov
After
after.1.mov