Open alexruffell opened 1 day ago
It seems to be related to this PR : https://github.com/home-assistant/frontend/pull/22593
@alexruffell Can you provide a short example demonstrating this issue with STOCK cards?
It think it's because most of stock cards have 100% height for the root element while custom button card doesn't.
Then this related to a custom card & should be fixed/styled on a custom card's side.
@ildar170975 How can you be certain it is not a bug introduced in the frontend given the change happened with the latest core beta? I guess the button-card
developer could determine that and then file an issue with frontend but is that the best approach?
Also, @piitaya found and fixed what I believe to be the same exact issue just a few versions (beta) back. I therefore assumed it was the same issue popping up again.
What I really need to do, is see if I can move back to the stock card on as many of these buttons as possible to avoid the added complications but I recall I chose to use this card on dozens of my views because it was significantly more flexible in its customization (time to revisit!).
@piitaya
most of stock cards have 100% height for the root element
I think we should do smth else than simply removing height: 100%
from horiz stack.
Check this example with stock cards:
type: horizontal-stack
cards:
- type: vertical-stack
cards:
- type: entity
entity: sun.sun
- type: entity
entity: sun.sun
- type: entity
entity: sun.sun
- type: entity
entity: sun.sun
- type: horizontal-stack
cards:
- type: entity
entity: sun.sun
- type: entity
entity: sun.sun
which gives this w/o height: 100%
:
Here the 2nd horiz stack does not occupy whole available area.
But before the fix it looked not better ))):
The initial goal of removing height: 100%
was to fix this nonsense:
Proposed to revert changes made in https://github.com/home-assistant/frontend/pull/22593. This fix eliminated some bugs - but added a new one. We need to find a different way.
@ildar170975 Are you using panel view for your examples?
Are you using panel view for your examples?
Ofc, this seems to happen in Panel only.
@piitaya Can we use this?
#root {
height: var(--horizontal-stack-card-height, auto);
...
}
#root hui-horizontal-stack-card {
--horizontal-stack-card-height: 100%;
}
If a stack is used inside another horizontal stack - height: 100%
.
By design the panel will take 100% height. It's not only a problem with horizontal stack. If you put any card it will take 100% of the height.
If you put any card it will take 100% of the height.
Yes, any card (which is not a stack) takes 100% in a panel mode. But if a horiz stack takes 100% - it may cause this:
or this (look at the left vert stack):
So, my proposal is to NOT allow occupying 100% for horiz stack - and only allow it if a horiz stack is placed inside another horiz stack.
But imho ideally would be adding smth like ha-card
for stack cards - currently height: 100%
is set to dev#root
and in case of a presence of a header will cause issues like this:
when div#root
overflows above a header.
Checklist
Describe the issue you are experiencing
Height of
type: custom:button-card
set to 100% is no longer respected. If I set it in px it works but doing so causes issues when viewing dashboard on different devices. The two tiny buttons should fill in the vertical space beneath them as they did in 2024.10.4 and prior versions. This issue (or very similar one) also happened one or two months ago and was resolved quickly upon reporting by @piitaya but I forget the issue#.Describe the behavior you expected
Buttons fill available space showing their icon and title as all the other buttons in the snapshot above.
Steps to reproduce the issue
YAML below is for the entire column. Using this YAML the problem will be visible.
What version of Home Assistant Core has the issue?
2024.11.0b1
What was the last working version of Home Assistant Core?
2024.10.4
In which browser are you experiencing the issue with?
Google 130.0.6723.70 (Official Build) (64-bit)
Which operating system are you using to run this browser?
Windows 11
State of relevant entities
No response
Problem-relevant frontend configuration