kinghat / tabbed-card

a custom card for home assistant that utilizes tabs to segregate individual cards.
MIT License
87 stars 10 forks source link

Bug: Tabbed Card forces following card beneath it #58

Open baal000 opened 1 year ago

baal000 commented 1 year ago

If you have multiple Cards on your Dashboard the Card that comes after the tabbed card is forced to stay below the tabbed card even if the window size would allow them to be rendered next to each other. See attachment_1 If you change the order they get rendered as you would expect it. See attachment_2

attachment_1 attachment_2

kinghat commented 1 year ago

this is likely due to HA assigning a default value of 1(50px) height to cards that dont set it themselves: https://developers.home-assistant.io/docs/frontend/custom-ui/custom-card/#api

Your card can define a getCardSize method that returns the size of your card as a number or a promise that will resolve to a number. A height of 1 is equivalent to 50 pixels. This will help Home Assistant distribute the cards evenly over the columns. A card size of 1 will be assumed if the method is not defined.

you can test this by adding a bunch of Tabbed Cards and they will eventually distribute themselves across the columns. i already have plans to implement this in the discussions -> feature requests: https://github.com/kinghat/tabbed-card/discussions/26

ildar170975 commented 4 months ago

This frontend PR could be related.