mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Fix autocomplete selection when options include emoji
Summary: Searching for matching choices was using nativeCompare for a binary search, while the list was sorted according to localeCompare. This was causing the search to fail for some strings when the two orderings differ. Test Plan: Tested manually Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3059
This commit is contained in:
parent
e1780e4f58
commit
43a62e7254
@ -163,7 +163,7 @@ export class ACIndexImpl<Item extends ACItem> implements ACIndex<Item> {
|
|||||||
*/
|
*/
|
||||||
private _findOverlaps(searchWord: string, searchWordPos: number): Map<number, number> {
|
private _findOverlaps(searchWord: string, searchWordPos: number): Map<number, number> {
|
||||||
const insertIndex = sortedIndex<{word: string}>(this._words, {word: searchWord},
|
const insertIndex = sortedIndex<{word: string}>(this._words, {word: searchWord},
|
||||||
(a, b) => nativeCompare(a.word, b.word));
|
(a, b) => localeCompare(a.word, b.word));
|
||||||
|
|
||||||
// Maps index of item to its score.
|
// Maps index of item to its score.
|
||||||
const scored = new Map<number, number>();
|
const scored = new Map<number, number>();
|
||||||
|
Loading…
Reference in New Issue
Block a user