forked from Ivasoft/mattermost-mobile
ignore the : character when searching for emojis in the emoji picker (#7453)
This commit is contained in:
@@ -44,7 +44,7 @@ const Picker = ({customEmojis, customEmojisEnabled, onEmojiPress, recentEmojis,
|
||||
|
||||
const onChangeSearchTerm = useCallback((text: string) => {
|
||||
setSearchTerm(text);
|
||||
searchCustom(text);
|
||||
searchCustom(text.replace(/^:|:$/g, '').trim());
|
||||
}, []);
|
||||
|
||||
const searchCustom = debounce((text: string) => {
|
||||
@@ -54,11 +54,12 @@ const Picker = ({customEmojis, customEmojisEnabled, onEmojiPress, recentEmojis,
|
||||
}, 500);
|
||||
|
||||
let EmojiList: React.ReactNode = null;
|
||||
if (searchTerm) {
|
||||
const term = searchTerm?.replace(/^:|:$/g, '').trim();
|
||||
if (term) {
|
||||
EmojiList = (
|
||||
<EmojiFiltered
|
||||
customEmojis={customEmojis}
|
||||
searchTerm={searchTerm}
|
||||
searchTerm={term}
|
||||
onEmojiPress={onEmojiPress}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user