Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Implemented custom filtering function #831

Merged
merged 10 commits into from
Dec 13, 2024
4 changes: 2 additions & 2 deletions components/annot-categorical.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
rmanaem marked this conversation as resolved.
Show resolved Hide resolved
return false;
}
Expand All @@ -164,11 +165,10 @@
while (labelIndex < label.length) {
if (label[labelIndex].toLowerCase() === searchChar) {
matchFound = true;
labelIndex++;
break;
}
labelIndex++;
}
labelIndex++;

if (!matchFound) {
return false;
Expand Down
4 changes: 2 additions & 2 deletions components/category-toolgroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -98,11 +99,10 @@
while (labelIndex < label.length) {
if (label[labelIndex].toLowerCase() === searchChar) {
matchFound = true;
labelIndex++;
break;
}
labelIndex++;
}
labelIndex++;
rmanaem marked this conversation as resolved.
Show resolved Hide resolved

if (!matchFound) {
return false;
Expand Down
Loading