Merge pull request #1 from alicelupsan/react-list-form
Fixed Caret RichTextField issues Related: #2945
This commit is contained in:
commit
8ec64337fd
|
@ -300,7 +300,7 @@ class ListForm extends React.Component<IListFormProps, IListFormState> {
|
|||
const data = this.state.fieldsSchema
|
||||
.reduce((newData, fld) => {
|
||||
if (fld.DefaultValue && fld.FieldType.indexOf("TaxonomyField") > -1) {
|
||||
newData[fld.InternalName] = fld.DefaultValue.replace(new RegExp("([#][0-9]+;#|^[0-9]+;#)", "g"), "")
|
||||
newData[fld.InternalName] = fld.DefaultValue.replace(new RegExp("([#][0-9]+;#|^[0-9]+;#)", "g"), "");
|
||||
} else {
|
||||
newData[fld.InternalName] = fld.DefaultValue;
|
||||
}
|
||||
|
|
|
@ -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}
|
||||
/>;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue