From 6126280f2d2456046e5ba87992b4dfa3b3be5b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Tue, 3 Dec 2024 17:33:59 +0100 Subject: [PATCH] Fix Markdown cards in Grid not taking full height (#23121) The implementation of show_empty property in #21379 introduced regression which causes Markdown cards rendered within a Grid card to not take full height of its space. This is because a visible card is now forced to have "display: block", while without that it's rendered as "display: inline". As the CSSStyleDeclaration.style mandates string type, it's not possible to delete or null the value. Setting it to an empty string seems to do the trick as well and the linter is happy too. Fixes #23119 --- src/panels/lovelace/cards/hui-markdown-card.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-markdown-card.ts b/src/panels/lovelace/cards/hui-markdown-card.ts index caf9fb502f1e..7660c3f416f6 100644 --- a/src/panels/lovelace/cards/hui-markdown-card.ts +++ b/src/panels/lovelace/cards/hui-markdown-card.ts @@ -111,7 +111,7 @@ export class HuiMarkdownCard extends LitElement implements LovelaceCard { this._config.show_empty === false && this._templateResult.result.length === 0; if (shouldBeHidden !== this.hidden) { - this.style.display = shouldBeHidden ? "none" : "block"; + this.style.display = shouldBeHidden ? "none" : ""; this.toggleAttribute("hidden", shouldBeHidden); fireEvent(this, "card-visibility-changed", { value: !shouldBeHidden }); }