From 4c5d58c243e3a7b568636ae3f4edf16281ec8dda Mon Sep 17 00:00:00 2001 From: Dominik Schab <54962889+domschab23@users.noreply.github.com> Date: Thu, 30 May 2024 15:44:37 -0400 Subject: [PATCH] Set RichTextEditor value to empty string if editor is empty (#1247) --- src/RichTextEditor/RichTextEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RichTextEditor/RichTextEditor.tsx b/src/RichTextEditor/RichTextEditor.tsx index a5549dcf..1b178805 100644 --- a/src/RichTextEditor/RichTextEditor.tsx +++ b/src/RichTextEditor/RichTextEditor.tsx @@ -171,7 +171,7 @@ const RichTextEditor = forwardRef(( extensions: editorExtensions, content: initialValue, onUpdate: ({ editor: ttEditor }) => { - const html = ttEditor.getHTML(); + const html = ttEditor.isEmpty ? '' : ttEditor.getHTML(); // if allowAttributes or allowedTags aren't passed // then use defaults from sanitize-html by not passing that key in the options