mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 20:36:35 +00:00
Trim text
This commit is contained in:
parent
fe2ae965b3
commit
fb2e1e5ebb
@ -123,18 +123,14 @@ class HuiInputSelectEntityRow extends LitElement implements EntityRow {
|
|||||||
|
|
||||||
private _selectedChanged(ev): void {
|
private _selectedChanged(ev): void {
|
||||||
const stateObj = this.hass!.states[this._config!.entity];
|
const stateObj = this.hass!.states[this._config!.entity];
|
||||||
const option = ev.detail.item.innerText;
|
const option = ev.target.selectedItem.innerText.trim();
|
||||||
if (option === stateObj.state) {
|
if (option === stateObj.state) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
forwardHaptic("light");
|
forwardHaptic("light");
|
||||||
|
|
||||||
setInputSelectOption(
|
setInputSelectOption(this.hass!, stateObj.entity_id, option);
|
||||||
this.hass!,
|
|
||||||
stateObj.entity_id,
|
|
||||||
ev.target.selectedItem.innerText
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class StateCardInputSelect extends LitElement {
|
|||||||
private async _selectedOptionChanged(
|
private async _selectedOptionChanged(
|
||||||
ev: PolymerIronSelectEvent<PaperItemElement>
|
ev: PolymerIronSelectEvent<PaperItemElement>
|
||||||
) {
|
) {
|
||||||
const option = ev.detail.item.innerText;
|
const option = ev.detail.item.innerText.trim();
|
||||||
if (option === this.stateObj.state) {
|
if (option === this.stateObj.state) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user