@rjsf/utils 5.24.8 → 5.24.10

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/utils.esm.js CHANGED
@@ -1187,7 +1187,7 @@ function computeDefaults(validator, rawSchema, computeDefaultsProps = {}) {
1187
1187
  defaults = schema[CONST_KEY];
1188
1188
  } else if (isObject(defaults) && isObject(schema.default)) {
1189
1189
  defaults = mergeObjects(defaults, schema.default);
1190
- } else if (DEFAULT_KEY in schema) {
1190
+ } else if (DEFAULT_KEY in schema && !schema[ANY_OF_KEY] && !schema[ONE_OF_KEY]) {
1191
1191
  defaults = schema.default;
1192
1192
  } else if (REF_KEY in schema) {
1193
1193
  const refName = schema[REF_KEY];
@@ -1240,7 +1240,7 @@ function computeDefaults(validator, rawSchema, computeDefaultsProps = {}) {
1240
1240
  schemaToCompute = oneOf[getClosestMatchingOption(
1241
1241
  validator,
1242
1242
  rootSchema,
1243
- rawFormData,
1243
+ rawFormData ?? schema.default,
1244
1244
  oneOf,
1245
1245
  0,
1246
1246
  discriminator,
@@ -1256,7 +1256,7 @@ function computeDefaults(validator, rawSchema, computeDefaultsProps = {}) {
1256
1256
  schemaToCompute = anyOf[getClosestMatchingOption(
1257
1257
  validator,
1258
1258
  rootSchema,
1259
- rawFormData,
1259
+ rawFormData ?? schema.default,
1260
1260
  anyOf,
1261
1261
  0,
1262
1262
  discriminator,
@@ -1293,7 +1293,7 @@ function computeDefaults(validator, rawSchema, computeDefaultsProps = {}) {
1293
1293
  experimental_defaultFormStateBehavior,
1294
1294
  experimental_customMergeAllOf
1295
1295
  );
1296
- if (!isObject(rawFormData)) {
1296
+ if (!isObject(rawFormData) || ALL_OF_KEY in schema) {
1297
1297
  defaultsWithFormData = mergeDefaultsWithFormData(
1298
1298
  defaultsWithFormData,
1299
1299
  matchingFormData,