Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

typeahead: Sort exact matches too, in case there are multiple.

N-Shar-mab89cd4358839
diff --git a/web/shared/src/typeahead.ts b/web/shared/src/typeahead.ts
index 82a28137041..23f13e4ee0c 100644
--- a/web/shared/src/typeahead.ts
+++ b/web/shared/src/typeahead.ts
@@ -155,7 +155,7 @@ export function triage<T>(
...beginswithCaseInsensitive,
].sort(sorting_comparator);
return {
- matches: [...exactMatch, ...non_exact_sorted_matches],
+ matches: [...exactMatch.sort(sorting_comparator), ...non_exact_sorted_matches],
rest: noMatch.sort(sorting_comparator),
};
}