File tree Expand file tree Collapse file tree
src/app/shared/form/builder/ds-dynamic-form-ui Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -581,19 +581,20 @@ export class DsDynamicFormControlContainerComponent extends DynamicFormControlCo
581581 }
582582 }
583583
584-
585- isNotRequiredGroupAndEmpty ( ) : boolean {
584+ isNotRequiredGroupAndEmpty ( ) : boolean {
586585 const parent = this . model . parent ;
587586 if ( hasValue ( parent ) && parent . type === 'GROUP' ) {
587+ console . log ( 'this.model' , this . model ) ;
588+ console . log ( 'parent' , parent ) ;
588589 const groupHasSomeValue = parent . group . some ( elem => ! ! elem . value ) ;
589590
590- if ( ! groupHasSomeValue && ! parent . isRequired ) {
591- this . group . reset ( )
592- }
591+ if ( ! groupHasSomeValue && ! parent . isRequired && parent . group ?. length > 1 ) {
592+ this . group . reset ( ) ;
593+ }
593594
594- return ( groupHasSomeValue && ! parent . isRequired ) || parent . isRequired ;
595+ return ( groupHasSomeValue && ! parent . isRequired ) || ( hasValue ( parent . isRequired ) && parent . isRequired ) ;
595596 } else {
596- return true
597+ return true ;
597598 }
598- }
599+ }
599600}
You can’t perform that action at this time.
0 commit comments