@esfaenza/forms-and-validations 11.2.159-beta1 → 11.2.159-beta10

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.
@@ -2368,6 +2368,7 @@
2368
2368
  * @param {NgModel} comp Elemento HTML marcato con "#validationControl"
2369
2369
  */
2370
2370
  BaseFormControl.prototype.registerValComp = function (comp) {
2371
+ var _a;
2371
2372
  if (comp) {
2372
2373
  // È arrivato un nuovo validationContorl (succede solo nel form-select quando cambia la source da 0 elementi / null ad N elementi, quindi al massimo una volta)
2373
2374
  if (this.validationControl && this.Form)
@@ -2375,10 +2376,12 @@
2375
2376
  this.validationControl = comp;
2376
2377
  //Questa serve per passare avanti i validatori
2377
2378
  if (this.UseUserValidators) {
2379
+ var validatorsToSet = ((_a = this._validators) === null || _a === void 0 ? void 0 : _a.filter(function (v) { return !v.ngOnInit; })) || null;
2378
2380
  //#DEBUG
2379
2381
  console.log("Validatori impostati a livello di base form per il validation control: " + this.validationControl.name);
2380
- console.log(this._validators);
2381
- this.validationControl.control.setValidators(this._validators);
2382
+ console.log(validatorsToSet);
2383
+ if (((validatorsToSet === null || validatorsToSet === void 0 ? void 0 : validatorsToSet.length) || 0) > 0)
2384
+ this.validationControl.control.setValidators(validatorsToSet);
2382
2385
  }
2383
2386
  //Se sono staccato dal Form (vuol dire che sono ad esempio dentro un ng-template) aggiungo il controllo al Form passato come input (context del template)
2384
2387
  if (this.Form && !this.formHasBeenBound) {
@@ -3892,6 +3895,7 @@
3892
3895
  setTimeout(function () {
3893
3896
  _this.Model = val ? val.description : value;
3894
3897
  _this.EvaluatedModel = _this.Model;
3898
+ _this.ngControl.control.updateValueAndValidity({ emitEvent: false });
3895
3899
  });
3896
3900
  };
3897
3901
  /**