Fix hide clear icon of entity picker (#24821)

This commit is contained in:
Alex Gustafsson 2025-03-28 09:04:40 +01:00 committed by GitHub
parent f39011f8f4
commit 9ca6a886f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -371,6 +371,7 @@ export class HaEntityPicker extends LitElement {
.renderer=${this._rowRenderer}
.required=${this.required}
.disabled=${this.disabled}
.hideClearIcon=${this.hideClearIcon}
@opened-changed=${this._openedChanged}
@value-changed=${this._valueChanged}
@filter-changed=${this._filterChanged}

View File

@ -105,6 +105,9 @@ export class HaComboBox extends LitElement {
@property({ type: Boolean, reflect: true }) public opened = false;
@property({ type: Boolean, attribute: "hide-clear-icon" })
public hideClearIcon = false;
@query("vaadin-combo-box-light", true) private _comboBox!: ComboBoxLight;
@query("ha-textfield", true) private _inputElement!: HaTextField;
@ -187,7 +190,7 @@ export class HaComboBox extends LitElement {
>
<slot name="icon" slot="leadingIcon"></slot>
</ha-textfield>
${this.value
${this.value && !this.hideClearIcon
? html`<ha-svg-icon
role="button"
tabindex="-1"