From 5062c35b8c526ea960f85075e3a81f083aa015f5 Mon Sep 17 00:00:00 2001 From: rhenck <richard.henck@iqb.hu-berlin.de> Date: Tue, 15 Oct 2024 12:42:41 +0200 Subject: [PATCH] Fix element model instantiation with empty label strings --- projects/common/models/elements/input-elements/checkbox.ts | 2 +- .../common/models/elements/input-elements/radio-button-group.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/common/models/elements/input-elements/checkbox.ts b/projects/common/models/elements/input-elements/checkbox.ts index a5ff7d001..82ef51059 100644 --- a/projects/common/models/elements/input-elements/checkbox.ts +++ b/projects/common/models/elements/input-elements/checkbox.ts @@ -32,7 +32,7 @@ export class CheckboxElement extends InputElement implements CheckboxProperties if (environment.strictInstantiation) { throw new InstantiationEror('Error at Checkbox instantiation', element); } - if (element?.label) this.label = element.label; + if (element?.label !== undefined) this.label = element.label; if (element?.value !== undefined) this.value = element.value; if (element?.crossOutChecked !== undefined) this.crossOutChecked = element.crossOutChecked; this.dimensions = PropertyGroupGenerators.generateDimensionProps({ diff --git a/projects/common/models/elements/input-elements/radio-button-group.ts b/projects/common/models/elements/input-elements/radio-button-group.ts index f3482eb0a..5f6d97bf5 100644 --- a/projects/common/models/elements/input-elements/radio-button-group.ts +++ b/projects/common/models/elements/input-elements/radio-button-group.ts @@ -39,7 +39,7 @@ export class RadioButtonGroupElement extends InputElement implements OptionEleme if (environment.strictInstantiation) { throw new InstantiationEror('Error at RadioButtonGroupElement instantiation', element); } - if (element?.label) this.label = element.label; + if (element?.label !== undefined) this.label = element.label; if (element?.options) this.options = [...element.options]; if (element?.alignment) this.alignment = element.alignment; if (element?.strikeOtherOptions) this.strikeOtherOptions = element.strikeOtherOptions; -- GitLab