tommoor / emojione-picker

A react emoji picker for use with emojione
http://tommoor.github.io/emojione-picker
MIT License
261 stars 61 forks source link

Search doesn't work as expected #43

Closed bradbirnbaum closed 7 years ago

bradbirnbaum commented 7 years ago

In search when I search for poop I would expect the poop icon to surface. The issue is that the regex for search is off of the keywords but it also should be off the name

ahutchings commented 7 years ago

This regex seems to work pretty well for finding emoji based on the name, and matches the rules the built-in MacOS emoji picker uses to match partial phrases:

new RegExp(`^(?:.* +)*${term}`, 'i');

I have this working in a local branch built on top of the changes in #50 and will submit a pull request once that moves forward.