mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge pull request #4239 from DSpace/backport-3968-to-dspace-8_x
[Port dspace-8_x] Fix - previously entered qualdrop value field is deleted when adding a new (emtpy) line with the same(!) qualifier and then deleting it
This commit is contained in:
@@ -362,7 +362,7 @@ export class FormComponent implements OnDestroy, OnInit {
|
|||||||
removeItem($event, arrayContext: DynamicFormArrayModel, index: number): void {
|
removeItem($event, arrayContext: DynamicFormArrayModel, index: number): void {
|
||||||
const formArrayControl = this.formGroup.get(this.formBuilderService.getPath(arrayContext)) as UntypedFormArray;
|
const formArrayControl = this.formGroup.get(this.formBuilderService.getPath(arrayContext)) as UntypedFormArray;
|
||||||
const event = this.getEvent($event, arrayContext, index, 'remove');
|
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
|
// In case of qualdrop value remove event must be dispatched before removing the control from array
|
||||||
this.removeArrayItem.emit(event);
|
this.removeArrayItem.emit(event);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user