fix(): readonly disable cut

This commit is contained in:
yanmao 2021-11-18 15:44:49 +08:00
parent c1d1b63646
commit 6173480172
1 changed files with 4 additions and 1 deletions

View File

@ -373,7 +373,10 @@ class NativeEvent {
change.event.onDocument('cut', (event) => {
const range = change.range.get();
if (!this.engine.container.contains(range.commonAncestorNode))
if (
!this.engine.container.contains(range.commonAncestorNode) ||
this.engine.readonly
)
return;
event.stopPropagation();
clipboard.write(event, undefined, () => {