mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-24 12:49:19 +00:00
Fix target picker device/floor icon (#27515)
* Fix device icon alginment * Expand target item group if new target is in there * Remove sticky header animation * Fix type attribute * Fix floor icon * Reflect collapsed * fix 0 entities target * Improve empty search
This commit is contained in:
@@ -18,7 +18,7 @@ export class HaTargetPickerItemGroup extends LitElement {
|
||||
Record<TargetType, string[]>
|
||||
>;
|
||||
|
||||
@property({ type: Boolean }) public collapsed = false;
|
||||
@property({ type: Boolean, reflect: true }) public collapsed = false;
|
||||
|
||||
@property({ attribute: false })
|
||||
public deviceFilter?: HaDevicePickerDeviceFilterFunc;
|
||||
@@ -50,7 +50,11 @@ export class HaTargetPickerItemGroup extends LitElement {
|
||||
}
|
||||
});
|
||||
|
||||
return html`<ha-expansion-panel .expanded=${!this.collapsed} left-chevron>
|
||||
return html`<ha-expansion-panel
|
||||
.expanded=${!this.collapsed}
|
||||
left-chevron
|
||||
@expanded-changed=${this._expandedChanged}
|
||||
>
|
||||
<div slot="header" class="heading">
|
||||
${this.hass.localize(
|
||||
`ui.components.target-picker.selected.${this.type}`,
|
||||
@@ -78,6 +82,10 @@ export class HaTargetPickerItemGroup extends LitElement {
|
||||
</ha-expansion-panel>`;
|
||||
}
|
||||
|
||||
private _expandedChanged(ev: CustomEvent) {
|
||||
this.collapsed = !ev.detail.expanded;
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
:host {
|
||||
display: block;
|
||||
|
||||
Reference in New Issue
Block a user