diff --git a/src/components/ha-dialog.ts b/src/components/ha-dialog.ts index 4459efb5b3..8c34add0e3 100644 --- a/src/components/ha-dialog.ts +++ b/src/components/ha-dialog.ts @@ -64,6 +64,7 @@ export class HaDialog extends MwcDialog { } .mdc-dialog .mdc-dialog__surface { position: var(--dialog-surface-position, relative); + top: var(--dialog-surface-top); min-height: var(--mdc-dialog-min-height, auto); } :host([flexContent]) .mdc-dialog .mdc-dialog__content { diff --git a/src/components/media-player/dialog-media-player-browse.ts b/src/components/media-player/dialog-media-player-browse.ts index 9f0c07436f..311536844f 100644 --- a/src/components/media-player/dialog-media-player-browse.ts +++ b/src/components/media-player/dialog-media-player-browse.ts @@ -43,7 +43,7 @@ class DialogMediaPlayerBrowse extends LitElement { public closeDialog() { this._params = undefined; - fireEvent(this, "dialog-closed", {dialog: this.localName}); + fireEvent(this, "dialog-closed", { dialog: this.localName }); } protected render(): TemplateResult { @@ -93,6 +93,9 @@ class DialogMediaPlayerBrowse extends LitElement { @media (min-width: 800px) { ha-dialog { --mdc-dialog-max-width: 800px; + --dialog-surface-position: fixed; + --dialog-surface-top: 40px; + --mdc-dialog-max-height: calc(100% - 72px); } ha-media-player-browse { width: 700px; diff --git a/src/components/media-player/ha-media-player-browse.ts b/src/components/media-player/ha-media-player-browse.ts index 5b3d637812..df10572558 100644 --- a/src/components/media-player/ha-media-player-browse.ts +++ b/src/components/media-player/ha-media-player-browse.ts @@ -18,8 +18,10 @@ import { } from "lit-element"; import { classMap } from "lit-html/directives/class-map"; import { ifDefined } from "lit-html/directives/if-defined"; +import { styleMap } from "lit-html/directives/style-map"; import memoizeOne from "memoize-one"; import { fireEvent } from "../../common/dom/fire_event"; +import { compare } from "../../common/string/compare"; import { computeRTLDirection } from "../../common/util/compute_rtl"; import { debounce } from "../../common/util/debounce"; import { @@ -30,6 +32,7 @@ import { MediaPlayerBrowseAction, } from "../../data/media-player"; import type { MediaPlayerItem } from "../../data/media-player"; +import { showAlertDialog } from "../../dialogs/generic/show-dialog-box"; import { installResizeObserver } from "../../panels/lovelace/common/install-resize-observer"; import { haStyle } from "../../resources/styles"; import type { HomeAssistant } from "../../types"; @@ -130,7 +133,11 @@ export class HaMediaPlayerBrowse extends LitElement { ? html`