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.
This commit is contained in:
Toby Zerner 2018-11-12 17:24:28 +10:30
parent 00b3d7b19a
commit 3d0097ea12

View File

@ -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;