@wavemaker/app-ng-runtime 11.7.2-next.26368 → 11.7.2-next.26370

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1315,7 +1315,9 @@
1315
1315
  if (controls) {
1316
1316
  // when current form is inside the list (i.e. incase of formArray).
1317
1317
  if (_.get(this.parentList, 'name') && controls.hasOwnProperty(this.parentList.name)) {
1318
- this.parentForm.ngform.removeControl(this.parentList.name);
1318
+ //get the index of current form in the list and remove the FormControl from FormArray
1319
+ const index = _.findIndex(this.parentList.getWidgets(this.name), { widgetId: this.widgetId });
1320
+ this.parentForm.ngform.controls[this.parentList.name].removeAt(index);
1319
1321
  }
1320
1322
  // when we have formGroupName set i.e. multiple formInstance with counter appended to formName
1321
1323
  if (this.formGroupName && controls.hasOwnProperty(this.formGroupName)) {