File tree Expand file tree Collapse file tree
src/app/shared/form/builder Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -505,9 +505,10 @@ export class FormBuilderService extends DynamicFormService {
505505 */
506506 updateModelValue ( fieldId : string , value : FormFieldMetadataValueObject ) : DynamicFormControlModel {
507507 let returnModel = null ;
508- this . formModels . forEach ( ( models , formId ) => {
508+ [ ...this . formModels . keys ( ) ] . find ( ( formId ) => {
509+ const models = this . formModels . get ( formId ) ;
509510 const fieldModel : any = this . findById ( fieldId , models ) ;
510- if ( hasValue ( fieldModel ) ) {
511+ if ( hasValue ( fieldModel ) && ! fieldModel . hidden ) {
511512 if ( isNotEmpty ( value ) ) {
512513 if ( fieldModel . repeatable && isNotEmpty ( fieldModel . value ) ) {
513514 // if model is repeatable and has already a value add a new field instead of replacing it
@@ -527,8 +528,9 @@ export class FormBuilderService extends DynamicFormService {
527528 returnModel = fieldModel ;
528529 }
529530 }
530- return ;
531+ return returnModel ;
531532 }
533+ return false ;
532534 } ) ;
533535 return returnModel ;
534536 }
You can’t perform that action at this time.
0 commit comments