From 89f6f16ba2eac4ac6d32a1d629918846900eb3cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 6 May 2020 19:28:59 +0200 Subject: [PATCH] Fix removal of option in select helper (#5777) --- src/panels/config/helpers/forms/ha-input_select-form.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/config/helpers/forms/ha-input_select-form.ts b/src/panels/config/helpers/forms/ha-input_select-form.ts index 4ad0f92e5d..8d1fa83b14 100644 --- a/src/panels/config/helpers/forms/ha-input_select-form.ts +++ b/src/panels/config/helpers/forms/ha-input_select-form.ts @@ -153,6 +153,7 @@ class HaInputSelectForm extends LitElement { } private async _removeOption(ev: Event) { + const index = (ev.target as any).index; if ( !(await showConfirmationDialog(this, { title: "Delete this item?", @@ -161,7 +162,6 @@ class HaInputSelectForm extends LitElement { ) { return; } - const index = (ev.target as any).index; const options = [...this._options]; options.splice(index, 1); fireEvent(this, "value-changed", {