Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 44615b2

Browse files
authored
Strip emoji variation when searching emoji by emoji (#11221)
1 parent c5befa1 commit 44615b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/views/emojipicker/EmojiPicker.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ class EmojiPicker extends React.Component<IProps, IState> {
306306
};
307307

308308
private emojiMatchesFilter = (emoji: IEmoji, filter: string): boolean => {
309+
// If the query is an emoji containing a variation then strip it to provide more useful matches
310+
if (filter.includes(ZERO_WIDTH_JOINER)) {
311+
filter = filter.split(ZERO_WIDTH_JOINER, 2)[0];
312+
}
309313
return (
310314
emoji.label.toLowerCase().includes(filter) ||
311315
(Array.isArray(emoji.emoticon)

0 commit comments

Comments
 (0)