From 281669f5af5f87a7629fba571fe4beb2fc0298df Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sat, 7 Mar 2026 20:05:33 -0600 Subject: [PATCH] fix recent emojis threshold --- .changset/app_emotes.md | 5 +++++ .../editor/autocomplete/EmoticonAutocomplete.tsx | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changset/app_emotes.md 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) {