mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
fix issue where adding multiple fields at the same time to an empty dropdown would only add the last field
This commit is contained in:
@@ -318,6 +318,12 @@ export class FormComponent implements OnDestroy, OnInit {
|
|||||||
const model = arrayContext.groups[arrayContext.groups.length - 1].group[0] as any;
|
const model = arrayContext.groups[arrayContext.groups.length - 1].group[0] as any;
|
||||||
if (model.type === DYNAMIC_FORM_CONTROL_TYPE_SCROLLABLE_DROPDOWN) {
|
if (model.type === DYNAMIC_FORM_CONTROL_TYPE_SCROLLABLE_DROPDOWN) {
|
||||||
model.value = Object.values(value)[0];
|
model.value = Object.values(value)[0];
|
||||||
|
const ctrl = formArrayControl.controls[formArrayControl.length - 1];
|
||||||
|
const ctrlValue = ctrl.value;
|
||||||
|
const ctrlValueKey = Object.keys(ctrlValue)[0];
|
||||||
|
ctrl.setValue({
|
||||||
|
[ctrlValueKey]: model.value
|
||||||
|
});
|
||||||
} else if (this.formBuilderService.isQualdropGroup(model)) {
|
} else if (this.formBuilderService.isQualdropGroup(model)) {
|
||||||
const ctrl = formArrayControl.controls[formArrayControl.length - 1];
|
const ctrl = formArrayControl.controls[formArrayControl.length - 1];
|
||||||
const ctrlKey = Object.keys(ctrl.value).find((key: string) => isNotEmpty(key.match(QUALDROP_GROUP_REGEX)));
|
const ctrlKey = Object.keys(ctrl.value).find((key: string) => isNotEmpty(key.match(QUALDROP_GROUP_REGEX)));
|
||||||
|
Reference in New Issue
Block a user