From 44615b2b04ed8b101bee3a6bc6723869a36cc2ef Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 12 Jul 2023 08:26:13 +0100 Subject: [PATCH] Strip emoji variation when searching emoji by emoji (#11221) --- 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 3158d52e55..edb5e427a3 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)