feat: ignore change events in readonly mode

This commit is contained in:
thecodrr
2022-07-06 18:40:37 +05:00
parent b859a77c12
commit 932dffb2b4

View File

@@ -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({