@rjsf/core 5.0.0-beta.19 → 5.0.0-beta.20

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.
package/dist/core.esm.js CHANGED
@@ -1085,7 +1085,7 @@ var AnyOfField = /*#__PURE__*/function (_Component) {
1085
1085
  }, widget, widgets);
1086
1086
  var rawErrors = get(errorSchema, ERRORS_KEY, []);
1087
1087
  var fieldErrorSchema = omit(errorSchema, [ERRORS_KEY]);
1088
- var option = retrievedOptions[selectedOption] || null;
1088
+ var option = selectedOption >= 0 ? retrievedOptions[selectedOption] || null : null;
1089
1089
  var optionSchema;
1090
1090
  if (option) {
1091
1091
  // If the subschema doesn't declare a type, infer the type from the
@@ -1118,7 +1118,7 @@ var AnyOfField = /*#__PURE__*/function (_Component) {
1118
1118
  multiple: false,
1119
1119
  rawErrors: rawErrors,
1120
1120
  errorSchema: fieldErrorSchema,
1121
- value: selectedOption,
1121
+ value: selectedOption >= 0 ? selectedOption : undefined,
1122
1122
  options: _extends({
1123
1123
  enumOptions: enumOptions
1124
1124
  }, uiOptions),
@@ -2066,7 +2066,7 @@ function BaseInputTemplate(props) {
2066
2066
  })), Array.isArray(schema.examples) && /*#__PURE__*/React.createElement("datalist", {
2067
2067
  key: "datalist_" + id,
2068
2068
  id: examplesId(id)
2069
- }, [].concat(new Set(schema.examples.concat(schema["default"] ? [schema["default"]] : []))).map(function (example) {
2069
+ }, schema.examples.concat(schema["default"] && !schema.examples.includes(schema["default"]) ? [schema["default"]] : []).map(function (example) {
2070
2070
  return /*#__PURE__*/React.createElement("option", {
2071
2071
  key: example,
2072
2072
  value: example
@@ -3499,7 +3499,7 @@ var Form = /*#__PURE__*/function (_Component) {
3499
3499
  if (!schemaUtils || schemaUtils.doesSchemaUtilsDiffer(props.validator, rootSchema)) {
3500
3500
  schemaUtils = createSchemaUtils(props.validator, rootSchema);
3501
3501
  }
3502
- var formData = schemaUtils.getDefaultFormState(schema, inputFormData);
3502
+ var formData = schemaUtils.getDefaultFormState(schema, inputFormData, "excludeObjectChildren");
3503
3503
  var retrievedSchema = schemaUtils.retrieveSchema(schema, formData);
3504
3504
  var getCurrentErrors = function getCurrentErrors() {
3505
3505
  if (props.noValidate) {