mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Fix hide clear icon of entity picker (#24821)
This commit is contained in:
parent
f39011f8f4
commit
9ca6a886f5
@ -371,6 +371,7 @@ export class HaEntityPicker extends LitElement {
|
|||||||
.renderer=${this._rowRenderer}
|
.renderer=${this._rowRenderer}
|
||||||
.required=${this.required}
|
.required=${this.required}
|
||||||
.disabled=${this.disabled}
|
.disabled=${this.disabled}
|
||||||
|
.hideClearIcon=${this.hideClearIcon}
|
||||||
@opened-changed=${this._openedChanged}
|
@opened-changed=${this._openedChanged}
|
||||||
@value-changed=${this._valueChanged}
|
@value-changed=${this._valueChanged}
|
||||||
@filter-changed=${this._filterChanged}
|
@filter-changed=${this._filterChanged}
|
||||||
|
@ -105,6 +105,9 @@ export class HaComboBox extends LitElement {
|
|||||||
|
|
||||||
@property({ type: Boolean, reflect: true }) public opened = false;
|
@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("vaadin-combo-box-light", true) private _comboBox!: ComboBoxLight;
|
||||||
|
|
||||||
@query("ha-textfield", true) private _inputElement!: HaTextField;
|
@query("ha-textfield", true) private _inputElement!: HaTextField;
|
||||||
@ -187,7 +190,7 @@ export class HaComboBox extends LitElement {
|
|||||||
>
|
>
|
||||||
<slot name="icon" slot="leadingIcon"></slot>
|
<slot name="icon" slot="leadingIcon"></slot>
|
||||||
</ha-textfield>
|
</ha-textfield>
|
||||||
${this.value
|
${this.value && !this.hideClearIcon
|
||||||
? html`<ha-svg-icon
|
? html`<ha-svg-icon
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user