-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Bug: should not be able to copy empty string #7862
Copy link
Copy link
Closed
Labels
copy+pasteRelates to Lexical Copy/PasteRelates to Lexical Copy/Pastegood first issueGood for newcomersGood for newcomers
Description
Lexical version: v0.33.1 (but should also exist in latest 0.35)
Steps To Reproduce
- Put cursor into a text field but don't select anything
- Trigger a copy (i.e. cmd+c on mac)
The current behavior
An empty string is copied into the clipboard
The expected behavior
Clipboard is not updated. Should not be able to copy "nothing".
Offending code is likely here:
| if (selection === null) { |
It only checks if selection is null, but it should also check if the selection is "empty" (i.e. isCollapsed)
Impact of fix
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
copy+pasteRelates to Lexical Copy/PasteRelates to Lexical Copy/Pastegood first issueGood for newcomersGood for newcomers