Strip emoji variation when searching emoji by emoji (#11221)
This commit is contained in:
parent
c5befa1ef8
commit
44615b2b04
1 changed files with 4 additions and 0 deletions
|
@ -306,6 +306,10 @@ class EmojiPicker extends React.Component<IProps, IState> {
|
||||||
};
|
};
|
||||||
|
|
||||||
private emojiMatchesFilter = (emoji: IEmoji, filter: string): boolean => {
|
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 (
|
return (
|
||||||
emoji.label.toLowerCase().includes(filter) ||
|
emoji.label.toLowerCase().includes(filter) ||
|
||||||
(Array.isArray(emoji.emoticon)
|
(Array.isArray(emoji.emoticon)
|
||||||
|
|
Loading…
Reference in a new issue