From 7a3b8a522fd249b5aa2126730aacf79322eb9747 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 2 Dec 2019 10:18:02 +0000 Subject: [PATCH] Make EmojiPicker filtering case-insensitive Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/emojipicker/EmojiPicker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/views/emojipicker/EmojiPicker.js b/src/components/views/emojipicker/EmojiPicker.js index 9fe8b4c81e..0ec11c2b38 100644 --- a/src/components/views/emojipicker/EmojiPicker.js +++ b/src/components/views/emojipicker/EmojiPicker.js @@ -62,7 +62,7 @@ EMOJIBASE.forEach(emoji => { DATA_BY_CATEGORY[categoryId].push(emoji); } // This is used as the string to match the query against when filtering emojis. - emoji.filterString = `${emoji.annotation}\n${emoji.shortcodes.join('\n')}}\n${emoji.emoticon || ''}`; + emoji.filterString = `${emoji.annotation}\n${emoji.shortcodes.join('\n')}}\n${emoji.emoticon || ''}`.toLowerCase(); }); export const CATEGORY_HEADER_HEIGHT = 22; @@ -201,6 +201,7 @@ class EmojiPicker extends React.Component { } onChangeFilter(filter) { + filter = filter.toLowerCase(); // filter is case insensitive stored lower-case for (const cat of this.categories) { let emojis; // If the new filter string includes the old filter string, we don't have to re-filter the whole dataset.