Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

feat: ignore change events in readonly mode

thecodrr932dffb2b44d
diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx
index 4eb09449f..bef4cc440 100644
--- a/apps/web/src/components/editor/tiptap.tsx
+++ b/apps/web/src/components/editor/tiptap.tsx
@@ -82,7 +82,8 @@ function TipTap(props: TipTapProps) {
});
},
onUpdate: ({ editor }) => {
- if (onChange) onChange(editor.getHTML(), counter.current);
+ if (onChange && editor.isEditable)
+ onChange(editor.getHTML(), counter.current);
},
onDestroy: () => {
configure({