Skip to content

Commit 7044cbd

Browse files
[CST-15396] fix method for error reset in non mandatory groups
1 parent cfe57e2 commit 7044cbd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/app/shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,9 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
583583

584584
isNotRequiredGroupAndEmpty(): boolean {
585585
const parent = this.model.parent;
586-
587-
if (hasValue(parent) && parent.type === 'GROUP') {
586+
// Check if the model is part of a group, the group needs to be an inner form and be in the submission form not in a nested form.
587+
// The check hasValue(parent.parent) tells if the parent is in the submission or in a modal (nested cases)
588+
if (hasValue(parent) && parent.type === 'GROUP' && this.model.isModelOfInnerForm && hasValue(parent.parent)) {
588589

589590
const groupHasSomeValue = parent.group.some(elem => !!elem.value);
590591

0 commit comments

Comments
 (0)