mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 05:57:54 +00:00
Adds clear value handler (#4205)
* Adds clear value handler * Add the same to device picker
This commit is contained in:
parent
4f41508110
commit
9e2a0c77d5
@ -164,6 +164,7 @@ class HaDevicePicker extends SubscribeMixin(LitElement) {
|
|||||||
slot="suffix"
|
slot="suffix"
|
||||||
class="clear-button"
|
class="clear-button"
|
||||||
icon="hass:close"
|
icon="hass:close"
|
||||||
|
@click=${this._clearValue}
|
||||||
no-ripple
|
no-ripple
|
||||||
>
|
>
|
||||||
Clear
|
Clear
|
||||||
@ -189,6 +190,10 @@ class HaDevicePicker extends SubscribeMixin(LitElement) {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _clearValue() {
|
||||||
|
this.value = "";
|
||||||
|
}
|
||||||
|
|
||||||
private get _value() {
|
private get _value() {
|
||||||
return this.value || "";
|
return this.value || "";
|
||||||
}
|
}
|
||||||
|
@ -166,6 +166,7 @@ class HaEntityPicker extends LitElement {
|
|||||||
slot="suffix"
|
slot="suffix"
|
||||||
class="clear-button"
|
class="clear-button"
|
||||||
icon="hass:close"
|
icon="hass:close"
|
||||||
|
@click=${this._clearValue}
|
||||||
no-ripple
|
no-ripple
|
||||||
>
|
>
|
||||||
Clear
|
Clear
|
||||||
@ -191,6 +192,10 @@ class HaEntityPicker extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _clearValue() {
|
||||||
|
this.value = "";
|
||||||
|
}
|
||||||
|
|
||||||
private get _value() {
|
private get _value() {
|
||||||
return this.value || "";
|
return this.value || "";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user