Don't copy if there's nothing to copy
This commit is contained in:
parent
bc3448fc48
commit
5adf080880
1 changed files with 2 additions and 0 deletions
|
@ -239,6 +239,8 @@
|
|||
let selectedDocument = selection.getRangeAt(0).cloneContents();
|
||||
if (!selectedDocument) return;
|
||||
|
||||
if (selectedDocument.textContent.length === 0) return;
|
||||
|
||||
e.preventDefault();
|
||||
clipboardData.setData('text/plain', selectedDocument.textContent);
|
||||
|
||||
|
|
Loading…
Reference in a new issue