From 1e73fa626d9dba12e2d4f5d9370fedebf8947817 Mon Sep 17 00:00:00 2001 From: VictorDuranEscire Date: Fri, 7 Feb 2025 21:12:03 -0600 Subject: [PATCH] Fix - Validate value on remove item for submission form only for qualdrop component --- src/app/shared/form/form.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/form/form.component.ts b/src/app/shared/form/form.component.ts index a757239aea..3f967e0a6e 100644 --- a/src/app/shared/form/form.component.ts +++ b/src/app/shared/form/form.component.ts @@ -362,7 +362,7 @@ export class FormComponent implements OnDestroy, OnInit { removeItem($event, arrayContext: DynamicFormArrayModel, index: number): void { const formArrayControl = this.formGroup.get(this.formBuilderService.getPath(arrayContext)) as UntypedFormArray; const event = this.getEvent($event, arrayContext, index, 'remove'); - if (this.formBuilderService.isQualdropGroup(event.model as DynamicFormControlModel)) { + if (this.formBuilderService.isQualdropGroup(event.model as DynamicFormControlModel) && hasValue((event.model as any)?.value)) { // In case of qualdrop value remove event must be dispatched before removing the control from array this.removeArrayItem.emit(event); }