Fixing 1711 - Bug with default taxonomy value
Added regex clean-up of the taxonomy strings in readData()
This commit is contained in:
parent
181f815aa7
commit
c0adbde8a9
|
@ -298,7 +298,15 @@ class ListForm extends React.Component<IListFormProps, IListFormState> {
|
|||
try {
|
||||
if ((formType === ControlMode.New) || !id) {
|
||||
const data = this.state.fieldsSchema
|
||||
.reduce((newData, fld) => { newData[fld.InternalName] = fld.DefaultValue; return newData; }, {});
|
||||
.reduce((newData, fld) => {
|
||||
if (fld.DefaultValue && fld.FieldType.indexOf("TaxonomyField") > -1) {
|
||||
newData[fld.InternalName] = fld.DefaultValue.replace(new RegExp("([#]?[0-9]+;#)", "g"), "")
|
||||
} else {
|
||||
newData[fld.InternalName] = fld.DefaultValue;
|
||||
}
|
||||
return newData;
|
||||
},
|
||||
{});
|
||||
this.setState({ ...this.state, data: data, originalData: { ...data }, fieldErrors: {}, isLoadingData: false });
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue