@rjsf/core 5.0.0-beta.13 → 5.0.0-beta.14

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.
@@ -903,8 +903,9 @@ class AnyOfField extends React.Component {
903
903
  }
904
904
  }
905
905
  }
906
- // Call getDefaultFormState to make sure defaults are populated on change.
907
- onChange(schemaUtils.getDefaultFormState(options[selectedOption], newFormData), undefined, this.getFieldId());
906
+ // Call getDefaultFormState to make sure defaults are populated on change. Pass "excludeObjectChildren"
907
+ // so that only the root objects themselves are created without adding undefined children properties
908
+ onChange(schemaUtils.getDefaultFormState(options[selectedOption], newFormData, "excludeObjectChildren"), undefined, this.getFieldId());
908
909
  this.setState({
909
910
  selectedOption: parseInt(option, 10)
910
911
  });
@@ -3435,7 +3436,7 @@ class Form extends React.Component {
3435
3436
  schemaValidationErrorSchema
3436
3437
  };
3437
3438
  } else if (!noValidate && newErrorSchema) {
3438
- const errorSchema = extraErrors ? utils.mergeObjects(newErrorSchema, extraErrors, true) : newErrorSchema;
3439
+ const errorSchema = extraErrors ? utils.mergeObjects(newErrorSchema, extraErrors, "preventDuplicates") : newErrorSchema;
3439
3440
  state = {
3440
3441
  formData: newFormData,
3441
3442
  errorSchema: errorSchema,