mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
Fix - Validate value on remove item for submission form only for qualdrop component
(cherry picked from commit 1e73fa626d
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
3a04ea8f79
commit
ae563442e7
@@ -316,7 +316,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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user