From 2e0cb4746a818cc328b1d205bb1956c7f354ceb3 Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 18 Jun 2020 14:20:40 -0400 Subject: [PATCH] fixup! Extend QueryMatcher's sorting heuristic --- src/autocomplete/QueryMatcher.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autocomplete/QueryMatcher.ts b/src/autocomplete/QueryMatcher.ts index a11928c1dd..7a0219e264 100644 --- a/src/autocomplete/QueryMatcher.ts +++ b/src/autocomplete/QueryMatcher.ts @@ -118,7 +118,7 @@ export default class QueryMatcher { const index = resultKey.indexOf(query); if (index !== -1 && (!this._options.shouldMatchPrefix || index === 0)) { matches.push( - ...candidates.map((candidate) => ({key, index, ...candidate})) + ...candidates.map((candidate) => ({index, ...candidate})) ); } }