Skip to content

Commit

Permalink
Set RichTextEditor value to empty string if editor is empty (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
domschab23 authored May 30, 2024
1 parent b576645 commit 4c5d58c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/RichTextEditor/RichTextEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c5d58c

Please sign in to comment.