Fix removal of option in select helper (#5777)

This commit is contained in:
Joakim Sørensen 2020-05-06 19:28:59 +02:00 committed by GitHub
parent 2d646da97f
commit 89f6f16ba2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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", {