@klippa/ngx-enhancy-forms 20.0.2 → 20.0.3

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.
@@ -402,13 +402,13 @@ class FormComponent {
402
402
  }
403
403
  return current;
404
404
  }
405
- unregisterControl(formControl) {
405
+ unregisterControl(formControl, formElement) {
406
406
  console.log('this.activeControls before', this.activeControls.length);
407
407
  console.log(this.activeControls);
408
- this.activeControls = this.activeControls.filter((e) => e.formControl !== formControl);
408
+ this.activeControls = this.activeControls.filter((e) => e.formControl !== formControl || e.formElement !== formElement);
409
409
  console.log('this.activeControls after', this.activeControls.length);
410
410
  if (this.parent) {
411
- this.parent.unregisterControl(formControl);
411
+ this.parent.unregisterControl(formControl, formElement);
412
412
  }
413
413
  }
414
414
  addFormGroupControls(formGroup, result) {
@@ -796,7 +796,7 @@ class FormElementComponent {
796
796
  }
797
797
  unregisterControl(formControl) {
798
798
  this.attachedControl = null;
799
- this.parent.unregisterControl(formControl);
799
+ this.parent.unregisterControl(formControl, this);
800
800
  }
801
801
  getAttachedControl() {
802
802
  return this.attachedControl;