From f9aab3061a3e4983de636ce3f30ef4be7b05b704 Mon Sep 17 00:00:00 2001 From: rhenck <richard.henck@iqb.hu-berlin.de> Date: Thu, 2 Dec 2021 17:34:19 +0100 Subject: [PATCH] [editor] Fix adding first drop list element Create object list, when none is existent yet. Otherwise append as before. --- .../properties-panel/element-model-properties.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/projects/editor/src/app/components/unit-view/page-view/properties-panel/element-model-properties.component.ts b/projects/editor/src/app/components/unit-view/page-view/properties-panel/element-model-properties.component.ts index 1234feb77..975f10dbc 100644 --- a/projects/editor/src/app/components/unit-view/page-view/properties-panel/element-model-properties.component.ts +++ b/projects/editor/src/app/components/unit-view/page-view/properties-panel/element-model-properties.component.ts @@ -53,7 +53,11 @@ export class ElementModelPropertiesComponent { addDropListOption(value: string): void { const id = this.unitService.getNewValueID(); - this.combinedProperties.value.push({ stringValue: value, id: id }); + if (this.combinedProperties.value) { + this.combinedProperties.value.push({ stringValue: value, id: id }); + } else { + this.combinedProperties.value = [{ stringValue: value, id: id }]; + } this.updateModel.emit({ property: 'value', value: this.combinedProperties.value }); } -- GitLab