From e02b231448444bb9282f32af0dca68239cd06652 Mon Sep 17 00:00:00 2001 From: Alice Rosa Date: Wed, 31 Aug 2022 07:59:04 +0300 Subject: [PATCH] Fixed Caret RichTextField issues Related: #2945 --- .../listForm/components/formFields/SPFieldRichTextEdit.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/samples/react-list-form/src/webparts/listForm/components/formFields/SPFieldRichTextEdit.tsx b/samples/react-list-form/src/webparts/listForm/components/formFields/SPFieldRichTextEdit.tsx index aca1a6df3..34cb86fc8 100755 --- a/samples/react-list-form/src/webparts/listForm/components/formFields/SPFieldRichTextEdit.tsx +++ b/samples/react-list-form/src/webparts/listForm/components/formFields/SPFieldRichTextEdit.tsx @@ -23,9 +23,6 @@ const SPFieldRichTextEdit: React.SFC = (props) => { tinymce.init({}); const { Name, RichTextMode } = props.fieldSchema; const value = props.value ? props.value : ''; - if (tinymce.editors[`Editor-${Name}`] !== undefined) { - tinymce.editors[`Editor-${Name}`].setContent(value); - } const editorConfig = { "relative_urls": false, "convert_urls": false, "remove_script_host": false, @@ -39,8 +36,8 @@ const SPFieldRichTextEdit: React.SFC = (props) => { return { props.valueChanged(event.target.getContent()); }} + value={value} + onEditorChange={props.valueChanged} />; };