From 3d0097ea12dae0ba92fba0a36e6b873a21fbc4ae Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 12 Nov 2018 17:24:28 +1030 Subject: [PATCH] Improve emoji suggestion sorting Not sure why emoji suggestions were being sorted by the length of their name... Reverting this means that exact matches are displayed at the top again which is good. --- extensions/emoji/js/src/forum/addComposerAutocomplete.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extensions/emoji/js/src/forum/addComposerAutocomplete.js b/extensions/emoji/js/src/forum/addComposerAutocomplete.js index 663e805fb..b5aed4bae 100644 --- a/extensions/emoji/js/src/forum/addComposerAutocomplete.js +++ b/extensions/emoji/js/src/forum/addComposerAutocomplete.js @@ -131,9 +131,7 @@ export default function addComposerAutocomplete() { emoji, name: emojiMap[emoji][0], code: getEmojiIconCode(emoji), - })).sort((a, b) => { - return a.name.length - b.name.length; - }).map(makeSuggestion); + })).map(makeSuggestion); if (suggestions.length) { dropdown.props.items = suggestions;