Skip to content

Commit 5d905d9

Browse files
committed
fix: lower case
1 parent 8395fd4 commit 5d905d9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/home/sorting/sorting-manager.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export class SortingManager {
5454

5555
const filterIssues = () => {
5656
try {
57-
const filterText = textBox.value;
57+
const filterText = textBox.value.toLowerCase();
5858
const issues = Array.from(issuesContainer.children) as HTMLDivElement[];
59-
59+
6060
// Reset any active sort buttons when searching
6161
if (filterText) {
6262
this._resetSortButtons();
@@ -74,25 +74,27 @@ export class SortingManager {
7474
issues.forEach((issue) => {
7575
const issueId = issue.children[0].getAttribute("data-issue-id");
7676
if (!issueId) return;
77-
77+
7878
const result = searchResults.get(parseInt(issueId));
7979
if (!result) return;
80-
80+
8181
issue.classList.add("active");
8282
issue.style.display = result.visible ? "block" : "none";
83-
83+
8484
if (result.score !== undefined) {
8585
issue.setAttribute("data-relevance-score", result.score.toFixed(3));
8686
}
8787
});
8888

8989
// If there's a search term, sort by relevance
9090
if (filterText) {
91-
issues.sort((a, b) => {
92-
const scoreA = parseFloat(a.getAttribute("data-relevance-score") || "0");
93-
const scoreB = parseFloat(b.getAttribute("data-relevance-score") || "0");
94-
return scoreB - scoreA; // Sort in descending order of relevance score
95-
}).forEach((issue) => issuesContainer.appendChild(issue));
91+
issues
92+
.sort((a, b) => {
93+
const scoreA = parseFloat(a.getAttribute("data-relevance-score") || "0");
94+
const scoreB = parseFloat(b.getAttribute("data-relevance-score") || "0");
95+
return scoreB - scoreA; // Sort in descending order of relevance score
96+
})
97+
.forEach((issue) => issuesContainer.appendChild(issue));
9698
}
9799
} catch (error) {
98100
return renderErrorInModal(error as Error);

0 commit comments

Comments
 (0)