Updated regex in default tax values

The regex was not capturing > 2 values correctly
This commit is contained in:
Fredrik Thorild 2021-02-22 09:51:23 +01:00
parent c0adbde8a9
commit 3055df775f

View File

@ -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]+;#)", "g"), "")
newData[fld.InternalName] = fld.DefaultValue.replace(new RegExp("([#][0-9]+;#|^[0-9]+;#)", "g"), "")
} else {
newData[fld.InternalName] = fld.DefaultValue;
}