diff --git a/components/annot-categorical.vue b/components/annot-categorical.vue index 8f9ec7a2..787b075e 100644 --- a/components/annot-categorical.vue +++ b/components/annot-categorical.vue @@ -152,6 +152,7 @@ "updateAnnotationCount" ]), filterOptions(option, label, search) { + // Match the first character of the label with the first character of the search string if (!label || search[0].toLowerCase() !== label[0].toLowerCase()) { return false; } @@ -164,11 +165,10 @@ while (labelIndex < label.length) { if (label[labelIndex].toLowerCase() === searchChar) { matchFound = true; - labelIndex++; break; } - labelIndex++; } + labelIndex++; if (!matchFound) { return false; diff --git a/components/category-toolgroup.vue b/components/category-toolgroup.vue index b64663a2..d7a9dca6 100644 --- a/components/category-toolgroup.vue +++ b/components/category-toolgroup.vue @@ -86,6 +86,7 @@ "alterColumnToToolMapping" ]), filterOptions(option, label, search) { + // Match the first character of the label with the first character of the search string if (!label || search[0].toLowerCase() !== label[0].toLowerCase()) { return false; } @@ -98,11 +99,10 @@ while (labelIndex < label.length) { if (label[labelIndex].toLowerCase() === searchChar) { matchFound = true; - labelIndex++; break; } - labelIndex++; } + labelIndex++; if (!matchFound) { return false;