diff --git a/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx b/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx index 9722c795..c3787691 100644 --- a/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx +++ b/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx @@ -57,14 +57,16 @@ export function EmoticonAutocomplete({ const searchList = useMemo(() => { const list: Array = []; - return list.concat( - imagePacks.flatMap((pack) => pack.getImagesFor(PackUsage.Emoticon)), - emojis - ); + return list + .concat( + imagePacks.flatMap((pack) => pack.getImagesFor(PackUsage.Emoticon)), + emojis + ) }, [imagePacks]); const [result, search, resetSearch] = useAsyncSearch(searchList, getEmoticonStr, SEARCH_OPTIONS); - const autoCompleteEmoticon = result ? result.items : recentEmoji; + const autoCompleteEmoticon = (result ? result.items : recentEmoji) + .sort((a, b) => a.shortcode.localeCompare(b.shortcode)); useEffect(() => { if (query.text) search(query.text); diff --git a/src/app/components/emoji-board/EmojiBoard.tsx b/src/app/components/emoji-board/EmojiBoard.tsx index 5a69df18..f81b75ec 100644 --- a/src/app/components/emoji-board/EmojiBoard.tsx +++ b/src/app/components/emoji-board/EmojiBoard.tsx @@ -468,7 +468,7 @@ export function SearchEmojiGroup({ return ( {tab === EmojiBoardTab.Emoji - ? searchResult.map((emoji) => + ? searchResult.sort((a, b) => a.shortcode.localeCompare(b.shortcode)).map((emoji) => 'unicode' in emoji ? ( {groups.map((pack) => ( - {pack.getEmojis().map((image) => ( + {pack.getEmojis().sort((a, b) => a.shortcode.localeCompare(b.shortcode)).map((image) => ( ( - {pack.getStickers().map((image) => ( + {pack.getStickers().sort((a, b) => a.shortcode.localeCompare(b.shortcode)).map((image) => (