From 7ef356d53bf641a29499e6e52d431b9c5a7becbf Mon Sep 17 00:00:00 2001
From: Richard Henck <richard.henck@iqb.hu-berlin.de>
Date: Fri, 6 Jan 2023 16:08:24 +0100
Subject: [PATCH] Fix alignment for child elements

For Droplists this needs to be done when multiple items are allowed.

For ToggleButtons it needs to be set when vertical orientation is used.

It is then centered without caring about text alignment. With multiple
item it would not be possible to align all of them anyway.
---
 .../components/compound-elements/cloze/cloze.component.ts    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/projects/common/components/compound-elements/cloze/cloze.component.ts b/projects/common/components/compound-elements/cloze/cloze.component.ts
index 12ae2f966..9c37a4653 100644
--- a/projects/common/components/compound-elements/cloze/cloze.component.ts
+++ b/projects/common/components/compound-elements/cloze/cloze.component.ts
@@ -158,6 +158,11 @@ import { ClozeElement } from 'common/models/elements/compound-elements/cloze/clo
         <aspect-compound-child-overlay
           *ngIf="['ToggleButton', 'DropList', 'TextField', 'Button'] | arrayIncludes:subPart.type"
           [style.display]="'inline-block'"
+          [style.vertical-align]="subPart.attrs.model.type === 'drop-list' &&
+                                    subPart.attrs.model.onlyOneItem === false ||
+                                  subPart.attrs.model.type === 'toggle-button' &&
+                                    subPart.attrs.model.verticalOrientation === true ?
+                                  'middle' : 'baseline'"
           [parentForm]="parentForm"
           [element]="$any(subPart).attrs.model"
           [editorMode]="editorMode"
-- 
GitLab