diff --git a/src/shell/components/FieldTypeTinyMCE/index.tsx b/src/shell/components/FieldTypeTinyMCE/index.tsx index 7ec3befd21..247d3bbddb 100644 --- a/src/shell/components/FieldTypeTinyMCE/index.tsx +++ b/src/shell/components/FieldTypeTinyMCE/index.tsx @@ -74,7 +74,6 @@ export const FieldTypeTinyMCE = React.memo(function FieldTypeTinyMCE({ // NOTE: controlled component const [initialValue, setInitialValue] = useState(value); const [isSkinLoaded, setIsSkinLoaded] = useState(false); - const [isDirty, setIsDirty] = useState(false); // NOTE: update if version changes useEffect(() => { @@ -115,16 +114,13 @@ export const FieldTypeTinyMCE = React.memo(function FieldTypeTinyMCE({ onFocusOut={onBlur} initialValue={initialValue} onEditorChange={(content, editor) => { - if (isDirty) { - onChange(content, name, datatype); + onChange(content, name, datatype); - const charCount = - editor.plugins?.wordcount?.body?.getCharacterCount() ?? 0; + const charCount = + editor.plugins?.wordcount?.body?.getCharacterCount() ?? 0; - onCharacterCountChange(charCount); - } + onCharacterCountChange(charCount); }} - onDirty={() => setIsDirty(true)} onInit={(_, editor) => { const charCount = editor.plugins?.wordcount?.body?.getCharacterCount() ?? 0;