Browse Source

refac: rich text input behaviour

Timothy Jaeryang Baek 5 tháng trước cách đây
mục cha
commit
fac8c3259c
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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: {