@overmap-ai/forms 1.0.4 → 1.0.5-fix-category-edit-crash.0

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/forms.js CHANGED
@@ -1475,10 +1475,11 @@ const initialFormValues = (fields, values) => {
1475
1475
  if (field instanceof FieldSection) {
1476
1476
  return { ...acc, ...initialFormValues(field.fields, values) };
1477
1477
  }
1478
- if (uncontrolledValues.includes(get(acc, field.getId()))) {
1479
- set(acc, field.getId(), "");
1478
+ const copy = { ...acc };
1479
+ if (uncontrolledValues.includes(get(copy, field.getId()))) {
1480
+ set(copy, field.getId(), "");
1480
1481
  }
1481
- return acc;
1482
+ return copy;
1482
1483
  }, values);
1483
1484
  };
1484
1485
  const defaultHandleSubmit = () => {