From f19077b2ce2ed8450257c29a12c77ec627cdd866 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Wed, 23 Aug 2023 22:05:21 +0800 Subject: [PATCH] fix: disable paste in read only mode #260 --- src/editor/core/cursor/CursorAgent.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/editor/core/cursor/CursorAgent.ts b/src/editor/core/cursor/CursorAgent.ts index e8e8e60..f7a5eff 100644 --- a/src/editor/core/cursor/CursorAgent.ts +++ b/src/editor/core/cursor/CursorAgent.ts @@ -53,6 +53,8 @@ export class CursorAgent { } private _paste(evt: ClipboardEvent) { + const isReadonly = this.draw.isReadonly() + if (isReadonly) return const clipboardData = evt.clipboardData if (!clipboardData) return const rangeManager = this.draw.getRange()