Fix chart tooltip footer always rendering (#9614)

This commit is contained in:
Bram Kragten 2021-07-27 00:01:32 +02:00 committed by GitHub
parent 32c6fb14dd
commit b05dc5141c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,12 +136,9 @@ export default class HaChartBase extends LitElement {
)}
</ul>
</div>
${this._tooltip.footer
? // footer has white-space: pre;
// prettier-ignore
html`<div class="footer">${Array.isArray(this._tooltip.footer)
? this._tooltip.footer.join("\n")
: this._tooltip.footer}
${this._tooltip.footer.length
? html`<div class="footer">
${this._tooltip.footer.map((item) => html`${item}<br />`)}
</div>`
: ""}
</div>`
@ -324,7 +321,6 @@ export default class HaChartBase extends LitElement {
}
.chartTooltip .footer {
font-weight: 500;
white-space: pre;
}
.chartTooltip .beforeBody {
text-align: center;