Skip to content

Commit

Permalink
Update src/utils/formUtil.ts
Browse files Browse the repository at this point in the history
Co-authored-by: John Teague <[email protected]>
  • Loading branch information
TanyaGashtold and johnformio authored Aug 23, 2024
1 parent c0018fb commit a497b67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/formUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ export const eachComponentData = (
if (isComponentModelType(component, 'dataObject')) {
// No need to bother processing all the children data if there is no data for this form or the reference value has not been loaded.
const nestedFormValue: any = get(data, component.path);
const noReferenceAttached = nestedFormValue && nestedFormValue._id && isEmpty(nestedFormValue.data) && !has(nestedFormValue, 'form');
const shouldProcessNestedFormData = nestedFormValue && nestedFormValue._id ? !noReferenceAttached : has(data, component.path);
const noReferenceAttached =nestedFormValue?._id && isEmpty(nestedFormValue.data) && !has(nestedFormValue, 'form');
const shouldProcessNestedFormData = nestedFormValue?._id ? !noReferenceAttached : has(data, component.path);
if (shouldProcessNestedFormData) {
// For nested forms, we need to reset the "data" and "path" objects for all of the children components, and then re-establish the data when it is done.
const childPath: string = componentDataPath(component, path, compPath);
Expand Down

0 comments on commit a497b67

Please sign in to comment.