@tft/crispr-forms 13.0.10 → 13.0.11

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.
@@ -242,10 +242,14 @@ function buildFormGroupFromConfig(config, value = null, group = new FormGroup({}
242
242
  if (isControlConfig(controlConfig)) {
243
243
  // then add a control to the group using the controlName from configuration
244
244
  const { controlName } = controlConfig;
245
+ if (group.get(controlName)) {
246
+ group.removeControl(controlName);
247
+ }
245
248
  // if there's a value object and it has a non-null/undefined value for this field use it.
246
249
  // Otherwise, default to null
247
250
  const controlValue = (value && value[controlName]) ?? null;
248
- group.addControl(controlName, createControlForType(controlConfig, controlValue));
251
+ const control = createControlForType(controlConfig, controlValue);
252
+ group.addControl(controlName, control);
249
253
  }
250
254
  });
251
255
  group.setValidators(config.validators);