diff --git a/.changset/app_emotes.md b/.changset/app_emotes.md new file mode 100644 index 00000000..5efb7e1e --- /dev/null +++ b/.changset/app_emotes.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +Fix recent emojis ignoring letter threshold. diff --git a/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx b/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx index d89c3504..c8466ae9 100644 --- a/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx +++ b/src/app/components/editor/autocomplete/EmoticonAutocomplete.tsx @@ -70,7 +70,12 @@ export function EmoticonAutocomplete({ getEmoticonSearchStr, SEARCH_OPTIONS ); - const autoCompleteEmoticon = result ? result.items.slice(0, 20) : recentEmoji; + const autoCompleteEmoticon = useMemo(() => { + if (query.text.length < emojiThreshold) { + return []; + } + return result ? result.items.slice(0, 20) : recentEmoji; + }, [query.text.length, emojiThreshold, result, recentEmoji]); useEffect(() => { if (query.text && query.text.length >= emojiThreshold) {