Open rmccue opened 5 years ago
Thanks for the detailed writeup! I'm a bit confused about what behavior, though, you're looking for. Maybe a code snippet would help explain?
@nolanlawson what he tried to say is can you add a way where a user can find an emoji this way :"emoji name": check discord/github emoji trigger basically ":" will trigger an event and will end that event with ":" like this π ":smile:"
We're using the
emojiIndex.search
function outside of Emoji Mart to provide autocompletions in a textarea. These are formatted similar to most other autocompletions, with the trigger character being a colon; e.g.:thu
->:thumbsup:
As part of this, we'd like to ensure we correctly autocomplete emoticon-style emoji; e.g.
:)
. The readme explicitly notes Emoji Mart is the "only emoji picker that returns emojis when searching for emoticons".However, right now, it's painful to use the search for this, as emoticons include the
:
and emoji names do not. This means when I begin typing:thu
, we have to search the index for both:thu
(to catch emoticons) andthu
(to catch regular emoji), then combine those results.Here's an example, where I type
:s
, which could complete to:confounded:
(π) or be the beginning of:speaker:
(π) or another emoji:Suggested Solution
search
should allow searching with the preceding colon.:s
should trigger a search through the emoji names for boths
and:s
.Alternatively, the short names could be stored with colons to simplify the search algorithm, but that's a fairly major change I imagine.