Fixed Caret RichTextField issues Related: #2945

This commit is contained in:
Alice Rosa 2022-08-31 07:59:04 +03:00
parent 678d265ec8
commit e02b231448
1 changed files with 2 additions and 5 deletions

View File

@ -23,9 +23,6 @@ const SPFieldRichTextEdit: React.SFC<ISPFormFieldProps> = (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<ISPFormFieldProps> = (props) => {
return <Editor
id={`Editor-${Name}`}
init={editorConfig}
initialValue={props.value}
onChange={(event) => { props.valueChanged(event.target.getContent()); }}
value={value}
onEditorChange={props.valueChanged}
/>;
};