ignore the : character when searching for emojis in the emoji picker (#7453)
This commit is contained in:
parent
bdcca34abf
commit
77859c0340
1 changed files with 4 additions and 3 deletions
|
|
@ -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}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue