Hi All,
i am trying to stack two horizontal cards into a horizontal card which is in a vertical stack. Unfortunately the height seems to be not calculated correctly. Now the elements are a bit over each other. I also tried to reduce complexity by just having the horizontal cards in the horizontal card. But the error is the same.
I want to achieve that on the inner horizontal card there is a title for the two button cards.
Code:
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: horizontal-stack
title: Büro
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: cover.buero_links_level
name: links
show_state: false
icon_height: 20px
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: cover.rolladen_office_rechts_level
name: rechts
icon_height: 20px
- type: horizontal-stack
title: Studio
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: cover.rolladen_fotostudio_links_level
name: links
icon_height: 20px
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: cover.rolladen_fotostudio_rechts_level
name: rechts
icon_height: 20px
- type: horizontal-stack
title: Schaufensterbeleuchtung
cards:
- show_name: true
show_icon: true
name: Büro
type: button
tap_action:
action: toggle
entity: switch.schaufenster_buero
- show_name: true
show_icon: true
name: Studio
type: button
tap_action:
action: toggle
entity: switch.schaufenster_studio
Can anyone help me to get this sorted out?
This is a bug.
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: horizontal-stack
title: title
cards:
- type: button
- type: button
- type: horizontal-stack
title: title
cards:
- type: button
- type: button
- type: horizontal-stack
title: stack title
cards:
- type: button
- type: button
- type: horizontal-stack
title: stack title
cards:
- type: button
- type: button
card-mod may be used as a temp. fix.
opened 03:33PM - 08 Dec 23 UTC
### Checklist
- [X] I have updated to the latest available Home Assistant ver… sion.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
### Describe the issue you are experiencing
Consider this card:
```
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: horizontal-stack
title: title
cards:
- show_name: true
show_icon: true
type: button
- type: button
- type: horizontal-stack
title: title
cards:
- type: button
- type: button
- type: horizontal-stack
title: stack title
cards:
- type: button
- type: button
- type: horizontal-stack
title: stack title
cards:
- type: button
- type: button
```
![изображение](https://github.com/home-assistant/frontend/assets/71872483/55fcfd38-d3a4-4d13-aacb-e31ec76cbb6f)
The upper horiz stack contains two horiz stacks.
Seems that inner stacks make buttons of wrong height.
As a result - the `stack title` text came under the upper stack:
![изображение](https://github.com/home-assistant/frontend/assets/71872483/ec4c1d98-705c-423e-bf02-663cc5e97ae2)
A correct look:
![изображение](https://github.com/home-assistant/frontend/assets/71872483/2d5def30-08c4-4f24-afec-1c3e1322c105)
### Describe the behavior you expected
Using horiz stacks inside a horz stack does not cause glitches.
### Steps to reproduce the issue
as above
### What version of Home Assistant Core has the issue?
2023.12.0
### What was the last working version of Home Assistant Core?
_No response_
### In which browser are you experiencing the issue with?
Chrome 119.0.6045.200
### Which operating system are you using to run this browser?
Win10x64
### State of relevant entities
_No response_
### Problem-relevant frontend configuration
_No response_
### Javascript errors shown in your browser console/inspector
_No response_
### Additional information
_No response_
1 Like
Thanks a lot, i was expecting that i missed some option somewhere, or it is generally not working. Thanks for opening the issue on github.
As a workaround - try using grid:
type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: grid
title: title
columns: 2
square: false
cards:
- show_name: true
show_icon: true
type: button
- type: button
- type: grid
title: title
columns: 2
square: false
cards:
- type: button
- type: button
- type: horizontal-stack
title: stack title
cards:
- type: button
- type: button
- type: horizontal-stack
title: stack title
cards:
- type: button
- type: button