diff --git a/src/ts/components/listselector.ts b/src/ts/components/listselector.ts index c8157295a..dc7535bda 100644 --- a/src/ts/components/listselector.ts +++ b/src/ts/components/listselector.ts @@ -77,12 +77,7 @@ export abstract class ListSelector extends Co } private getItemIndex(key: string): number { - for (let index in this.items) { - if (key === this.items[index].key) { - return parseInt(index); - } - } - return -1; + return this.items.findIndex((item) => item.key === key); } /**