From 73460c7d8aec6bb4b7223d6e79681b7fc576d8cf Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 30 Jan 2024 13:51:12 +0100 Subject: [PATCH] Fix more info remote (#19575) --- .../more-info/controls/more-info-remote.ts | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-remote.ts b/src/dialogs/more-info/controls/more-info-remote.ts index 072741fd2a..382fcff7d8 100644 --- a/src/dialogs/more-info/controls/more-info-remote.ts +++ b/src/dialogs/more-info/controls/more-info-remote.ts @@ -1,6 +1,6 @@ -import "@material/mwc-list/mwc-list"; +import "@material/mwc-select/mwc-select"; import "@material/mwc-list/mwc-list-item"; -import { html, LitElement, nothing } from "lit"; +import { css, html, LitElement, nothing } from "lit"; import { customElement, property } from "lit/decorators"; import { stopPropagation } from "../../../common/dom/stop_propagation"; import { supportsFeature } from "../../../common/entity/supports-feature"; @@ -26,17 +26,17 @@ class MoreInfoRemote extends LitElement { return html` ${supportsFeature(stateObj, REMOTE_SUPPORT_ACTIVITY) ? html` - - ${stateObj.attributes.activity_list!.map( + ${stateObj.attributes.activity_list?.map( (activity) => html` ${this.hass.formatEntityAttributeValue( @@ -47,7 +47,7 @@ class MoreInfoRemote extends LitElement { ` )} - + ` : nothing} @@ -59,7 +59,7 @@ class MoreInfoRemote extends LitElement { `; } - private handleActivityChanged(ev) { + private _handleActivityChanged(ev) { const oldVal = this.stateObj!.attributes.current_activity; const newVal = ev.target.value; @@ -72,6 +72,12 @@ class MoreInfoRemote extends LitElement { activity: newVal, }); } + + static styles = css` + mwc-select { + width: 100%; + } + `; } declare global {