fix: Panel height should be 100% when casted (#1750)

This commit is contained in:
Dermot Duffy
2024-12-13 08:11:26 -08:00
committed by GitHub
parent e0335c529c
commit ed0bb99a45
7 changed files with 53 additions and 19 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
import { LitElement, ReactiveControllerHost } from 'lit';
import { ActionEventTarget } from '../action-handler-directive';
import { setOrRemoveAttribute } from '../utils/basic';
import { isBeingCasted } from '../utils/casting';
import { isCardInPanel } from '../utils/ha';
import { ActionExecutionRequestEventTarget } from './actions/utils/execution-request';
import { InitializationAspect } from './initialization-manager';
@@ -83,7 +84,7 @@ export class CardElementManager {
// Whether or not the card is in panel mode on the dashboard.
setOrRemoveAttribute(this._element, isCardInPanel(this._element), 'panel');
setOrRemoveAttribute(this._element, true, 'tabindex', '0');
setOrRemoveAttribute(this._element, isBeingCasted(), 'casted');
this._api.getFullscreenManager().connect();
@@ -137,6 +138,7 @@ export class CardElementManager {
public elementDisconnected(): void {
setOrRemoveAttribute(this._element, false, 'panel');
setOrRemoveAttribute(this._element, false, 'tabindex');
setOrRemoveAttribute(this._element, false, 'casted');
// When the dashboard 'tab' is changed, the media is effectively unloaded.
this._api.getMediaLoadedInfoManager().clear();