typeahead: Use startsWith instead of a falsey index check.

This commit is contained in:
evykassirer
2024-03-01 14:20:04 -08:00
committed by Tim Abbott
parent b034875216
commit bb68dde1da

View File

@@ -350,7 +350,7 @@ import {get_string_diff} from "../../src/util";
let item;
while ((item = items.shift())) {
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) {
if (item.toLowerCase().startsWith(this.query.toLowerCase())) {
beginswith.push(item);
} else if (item.includes(this.query)) {
caseSensitive.push(item);