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

Commit

Permalink
Strip emoji variation when searching emoji by emoji (#11221)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Jul 12, 2023
1 parent c5befa1 commit 44615b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/views/emojipicker/EmojiPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ class EmojiPicker extends React.Component<IProps, IState> {
};

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)
Expand Down

0 comments on commit 44615b2

Please sign in to comment.