mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 12:16:39 +00:00
Fix resize observer on error card (#5158)
* Fix resize observer on error card * Update hui-media-control-card.ts
This commit is contained in:
parent
73e0fd614e
commit
f54cd18da4
@ -521,7 +521,12 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {
|
|||||||
debounce(() => this._measureCard(), 250, false)
|
debounce(() => this._measureCard(), 250, false)
|
||||||
);
|
);
|
||||||
|
|
||||||
this._resizeObserver.observe(this.shadowRoot!.querySelector("ha-card")!);
|
const card = this.shadowRoot!.querySelector("ha-card");
|
||||||
|
// If we show an error or warning there is no ha-card
|
||||||
|
if (!card) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._resizeObserver.observe(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _handleMoreInfo(): void {
|
private _handleMoreInfo(): void {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user