From 3b0ad3bae13ee26c622ab708dd486b9888384dd2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 11 Jul 2023 10:41:16 +0100 Subject: [PATCH] Strip emoji variation when searching emoji by emoji --- src/components/views/emojipicker/EmojiPicker.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/views/emojipicker/EmojiPicker.tsx b/src/components/views/emojipicker/EmojiPicker.tsx index 3158d52e553..edb5e427a3a 100644 --- a/src/components/views/emojipicker/EmojiPicker.tsx +++ b/src/components/views/emojipicker/EmojiPicker.tsx @@ -306,6 +306,10 @@ class EmojiPicker extends React.Component { }; private emojiMatchesFilter = (emoji: IEmoji, filter: string): boolean => { + // If the query is an emoji containing a variation then strip it to provide more useful matches + if (filter.includes(ZERO_WIDTH_JOINER)) { + filter = filter.split(ZERO_WIDTH_JOINER, 2)[0]; + } return ( emoji.label.toLowerCase().includes(filter) || (Array.isArray(emoji.emoticon)