浏览代码

refac: rich text input behaviour

Timothy Jaeryang Baek 5 月之前
父节点
当前提交
fac8c3259c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/lib/components/common/RichTextInput.svelte

+ 4 - 0
src/lib/components/common/RichTextInput.svelte

@@ -158,6 +158,10 @@
 				const newValue = turndownService.turndown(editor.getHTML());
 				if (value !== newValue) {
 					value = newValue;
+
+					if (value === '') {
+						editor.commands.clearContent();
+					}
 				}
 			},
 			editorProps: {