Skip to content

Commit

Permalink
fix(doc): copy error when range is empty (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jocs authored Mar 5, 2024
1 parent 885ba4b commit 1ae73ca
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/docs-ui/src/services/clipboard/clipboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export class DocClipboardService extends Disposable implements IDocClipboardServ

async copy(): Promise<boolean> {
const documentBodyList = this._getDocumentBodyInRanges();

if (documentBodyList.length === 0) {
return false;
}

try {
this._setClipboardData(documentBodyList);
} catch (e) {
Expand Down

0 comments on commit 1ae73ca

Please sign in to comment.