From 6891eb9ff88d9a333027b85d7e5628f723c37b3f Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Wed, 10 Dec 2025 16:59:35 +0100 Subject: [PATCH] Fix target picker area in history/activity (#28474) * Add max target picker width for history and activity * Fix target picker area selection in history and activity --- src/components/ha-generic-picker.ts | 5 ++++- src/components/ha-target-picker.ts | 3 --- src/panels/history/ha-panel-history.ts | 1 + src/panels/logbook/ha-panel-logbook.ts | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/ha-generic-picker.ts b/src/components/ha-generic-picker.ts index 041b068cfb..061c5f6834 100644 --- a/src/components/ha-generic-picker.ts +++ b/src/components/ha-generic-picker.ts @@ -367,7 +367,10 @@ export class HaGenericPicker extends LitElement { wa-popover::part(body) { width: max(var(--body-width), 250px); - max-width: max(var(--body-width), 250px); + max-width: var( + --ha-generic-picker-max-width, + max(var(--body-width), 250px) + ); max-height: 500px; height: 70vh; overflow: hidden; diff --git a/src/components/ha-target-picker.ts b/src/components/ha-target-picker.ts index 171835f7da..ad9d38ab84 100644 --- a/src/components/ha-target-picker.ts +++ b/src/components/ha-target-picker.ts @@ -964,10 +964,7 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) { let hasFloor = false; let rtl = false; let showEntityId = false; - if (type === "area" || type === "floor") { - item.id = item[type]?.[`${type}_id`]; - rtl = computeRTL(this.hass); hasFloor = type === "area" && !!(item as FloorComboBoxItem).area?.floor_id; diff --git a/src/panels/history/ha-panel-history.ts b/src/panels/history/ha-panel-history.ts index 64675ed020..12d5f32bae 100644 --- a/src/panels/history/ha-panel-history.ts +++ b/src/panels/history/ha-panel-history.ts @@ -632,6 +632,7 @@ class HaPanelHistory extends LitElement { :host([virtualize]) { height: 100%; + --ha-generic-picker-max-width: 400px; } .progress-wrapper { diff --git a/src/panels/logbook/ha-panel-logbook.ts b/src/panels/logbook/ha-panel-logbook.ts index 365731df37..1f8d5eb2f4 100644 --- a/src/panels/logbook/ha-panel-logbook.ts +++ b/src/panels/logbook/ha-panel-logbook.ts @@ -303,6 +303,9 @@ export class HaPanelLogbook extends LitElement { return [ haStyle, css` + :host { + --ha-generic-picker-max-width: 400px; + } ha-logbook { height: calc( 100vh -