From d7a7527a8f7dbfeee96300ff87daa6e952937499 Mon Sep 17 00:00:00 2001 From: fantasticit Date: Tue, 26 Apr 2022 19:34:39 +0800 Subject: [PATCH] tiptap: disable edit mind if is not editable --- packages/client/src/tiptap/wrappers/mind/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/client/src/tiptap/wrappers/mind/index.tsx b/packages/client/src/tiptap/wrappers/mind/index.tsx index eb154e4..d517587 100644 --- a/packages/client/src/tiptap/wrappers/mind/index.tsx +++ b/packages/client/src/tiptap/wrappers/mind/index.tsx @@ -111,6 +111,10 @@ export const MindWrapper = ({ editor, node, updateAttributes }) => { minder.execCommand('theme', theme); minder.execCommand('zoom', parseInt(zoom)); + if (!isEditable) { + minder.disable(); + } + $mind.current = minder; minder.on('contentChange', onChange); toggleLoading(false);