From 5b3e8945a9826ae5b385d73cc343af29a99524e5 Mon Sep 17 00:00:00 2001 From: pubuzhixing8 Date: Wed, 31 Jul 2024 11:13:55 +0800 Subject: [PATCH] fix(mind): should not trigger image focus when board is readonly --- .changeset/olive-pigs-smell.md | 5 +++++ packages/mind/src/plugins/with-node-image.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/olive-pigs-smell.md diff --git a/.changeset/olive-pigs-smell.md b/.changeset/olive-pigs-smell.md new file mode 100644 index 000000000..6ede9a30f --- /dev/null +++ b/.changeset/olive-pigs-smell.md @@ -0,0 +1,5 @@ +--- +'@plait/mind': patch +--- + +should not trigger focus when board is readonly diff --git a/packages/mind/src/plugins/with-node-image.ts b/packages/mind/src/plugins/with-node-image.ts index 412b23ea1..fa3dc6c8a 100644 --- a/packages/mind/src/plugins/with-node-image.ts +++ b/packages/mind/src/plugins/with-node-image.ts @@ -43,6 +43,10 @@ export const withNodeImage = (board: PlaitBoard) => { pointerUp(event); return; } + if (PlaitBoard.isReadonly(board)) { + pointerUp(event); + return; + } const point = toViewBoxPoint(board, toHostPoint(board, event.x, event.y)); const hitElement = getHitElementByPoint(board, point); const isHitImageResult =