From e0f2869374e43c4b02a9fb1b3c8a0ed7c7388fda Mon Sep 17 00:00:00 2001 From: Aakansha Doshi Date: Sat, 13 May 2023 22:47:29 +0530 Subject: [PATCH] fix: assign the original text to text editor only during init (#6580) --- src/element/textWysiwyg.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsx index 63bc9e4a..d5fa0aad 100644 --- a/src/element/textWysiwyg.tsx +++ b/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) {