[CST-3782] patch add entire array on item remove

This commit is contained in:
Alessandro Martelli
2021-03-31 14:20:44 +02:00
parent f9e80ea288
commit 08afa4723b
2 changed files with 9 additions and 1 deletions

View File

@@ -296,6 +296,13 @@ export class SectionFormOperationsService {
protected dispatchOperationsFromRemoveEvent(pathCombiner: JsonPatchOperationPathCombiner,
event: DynamicFormControlEvent,
previousValue: FormFieldPreviousValueObject): void {
if (event.context && event.context instanceof DynamicFormArrayGroupModel) {
// Model is a DynamicRowArrayModel
this.handleArrayGroupPatch(pathCombiner, event, (event as any).context.context);
return;
}
const path = this.getFieldPathFromEvent(event);
const value = this.getFieldValueFromChangeEvent(event);
console.log(value);