Skip to content

Commit

Permalink
Merge pull request #797 from ephemeraHQ/ar/hundo
Browse files Browse the repository at this point in the history
fix: Made emoji search a bit better
  • Loading branch information
saulmc authored Sep 25, 2024
2 parents 3206e81 + 70710af commit 4b871af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions containers/EmojiPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ export const EmojiPicker = () => {

const filteredReactions = useMemo(() => {
return sliceEmojis(
flatEmojis.filter((emoji) =>
emoji.keywords.some((keyword) =>
keyword.includes(searchInput.toLowerCase().trim())
)
)
flatEmojis.filter((emoji) => {
const cleanedSearch = searchInput.toLowerCase().trim();
return (
emoji.keywords.some((keyword) => keyword.includes(cleanedSearch)) ||
emoji.name.includes(cleanedSearch) ||
emoji.emoji === cleanedSearch
);
})
);
}, [searchInput]);
const closeMenu = useCallback(() => {
Expand Down
1 change: 1 addition & 0 deletions utils/emojis/emojis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1463,6 +1463,7 @@ export const emojis = [
"test",
"pass",
"hundred",
"100",
],
},
{
Expand Down

0 comments on commit 4b871af

Please sign in to comment.