浏览代码

fix: assign the original text to text editor only during init (#6580)

Aakansha Doshi 2 年之前
父节点
当前提交
e0f2869374
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/element/textWysiwyg.tsx

+ 1 - 1
src/element/textWysiwyg.tsx

@@ -254,7 +254,6 @@ export const textWysiwyg = ({
       const initialSelectionStart = editable.selectionStart;
       const initialSelectionEnd = editable.selectionEnd;
       const initialLength = editable.value.length;
-      editable.value = updatedTextElement.originalText;
 
       // restore cursor position after value updated so it doesn't
       // go to the end of text when container auto expanded
@@ -358,6 +357,7 @@ export const textWysiwyg = ({
     overflowWrap: "break-word",
     boxSizing: "content-box",
   });
+  editable.value = element.originalText;
   updateWysiwygStyle();
 
   if (onChange) {