Timothy Jaeryang Baek 3 ماه پیش
والد
کامیت
ce7cc37077
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      src/lib/components/common/RichTextInput.svelte

+ 3 - 1
src/lib/components/common/RichTextInput.svelte

@@ -215,7 +215,9 @@
 
 							if (state.length === 2 && state[0] === 0 && state[1] === 0) {
 								// Empty state, check if we have content to initialize
-								if (content) {
+								// check if editor empty as well
+								const isEmptyEditor = !editor || editor.getText().trim() === '';
+								if (content && isEmptyEditor) {
 									const pydoc = prosemirrorJSONToYDoc(editor.schema, content);
 									if (pydoc) {
 										Y.applyUpdate(this.doc, Y.encodeStateAsUpdate(pydoc));