diff --git a/src/components/Editing/CustomEditor.tsx b/src/components/Editing/CustomEditor.tsx index 9d842295cf4b88870fba1b87ed1a004b4881ac9f..1c174d850ade9912775ea845c7a689cfe91501ce 100644 --- a/src/components/Editing/CustomEditor.tsx +++ b/src/components/Editing/CustomEditor.tsx @@ -41,10 +41,14 @@ const CustomEditor: React.FC<CustomEditorProps> = ({ const handleStateChange = useCallback( (state: EditorState) => { setEditorState(state) - handleChange( - stateToHTML(state.getCurrentContent(), { entityStyleFn }), - editorType - ) + if (state.getCurrentContent().hasText()) { + handleChange( + stateToHTML(state.getCurrentContent(), { entityStyleFn }), + editorType + ) + } else { + handleChange('', editorType) + } }, [editorType, handleChange, entityStyleFn] )