diff --git a/components/annot-categorical.vue b/components/annot-categorical.vue index 8f9ec7a2..d26c4e17 100644 --- a/components/annot-categorical.vue +++ b/components/annot-categorical.vue @@ -152,24 +152,25 @@ "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; } - let labelIndex = 1; + let labelIndex = 0; for (let searchIndex = 1; searchIndex < search.length; searchIndex++) { const searchChar = search[searchIndex].toLowerCase(); let matchFound = false; - while (labelIndex < label.length) { + while (labelIndex < label.length-1) { + labelIndex++; if (label[labelIndex].toLowerCase() === searchChar) { matchFound = true; - labelIndex++; break; } - labelIndex++; } + if (!matchFound) { return false; } diff --git a/components/category-toolgroup.vue b/components/category-toolgroup.vue index b64663a2..b770ba31 100644 --- a/components/category-toolgroup.vue +++ b/components/category-toolgroup.vue @@ -86,22 +86,22 @@ "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; } - let labelIndex = 1; + let labelIndex = 0; for (let searchIndex = 1; searchIndex < search.length; searchIndex++) { const searchChar = search[searchIndex].toLowerCase(); let matchFound = false; - while (labelIndex < label.length) { + while (labelIndex < label.length-1) { + labelIndex++; if (label[labelIndex].toLowerCase() === searchChar) { matchFound = true; - labelIndex++; break; } - labelIndex++; } if (!matchFound) { diff --git a/cypress.config.js b/cypress.config.js index 53de9698..515be76d 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -35,6 +35,7 @@ module.exports = defineConfig({ component: { viewportHeight: 1080, viewportWidth: 1920, + devServer: { bundler: "webpack",