only clone for add events

This commit is contained in:
Art Lowel
2020-08-05 16:03:51 +02:00
parent 8bfccaa624
commit d560e08b20

View File

@@ -250,10 +250,7 @@ export class SectionFormOperationsService {
fieldValue = new FormFieldMetadataValueObject(value);
}
// make a copy of fieldvalue for returning,
// so any changes to it can't influence the original.
// fixes #817
return deepClone(fieldValue);
return fieldValue;
}
/**
@@ -314,7 +311,7 @@ export class SectionFormOperationsService {
event: DynamicFormControlEvent
): void {
const path = this.getFieldPathSegmentedFromChangeEvent(event);
const value = this.getFieldValueFromChangeEvent(event);
const value = deepClone(this.getFieldValueFromChangeEvent(event));
if (isNotEmpty(value)) {
value.place = this.getArrayIndexFromEvent(event);
if (hasValue(event.group) && hasValue(event.group.value)) {