@klippa/ngx-enhancy-forms 20.0.2 → 20.0.4

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