webscopeio / react-textarea-autocomplete

📝 React component implements configurable GitHub's like textarea autocomplete.
MIT License
451 stars 80 forks source link

Allows embedded keys with data #57

Closed alecklandgraf closed 6 years ago

alecklandgraf commented 6 years ago

Add support for using RTA with duplicate values.

Say you want beer, happy_hour, and draft to return the same emoji, 🍺, this change allows that.

I also fixed what I think was a invalid check of data's type.

alecklandgraf commented 6 years ago

@jukben PTAL I updated to use Array.isArray and added explicit tests for the keys.

Thanks for adding me to the collaborators!

jukben commented 6 years ago

Please be aware that we already have outputItem (just with small o), but in your case you probably want to use textToReplaceType. Could you please refactor your code? We are almost there. Thanks a lot for your cooperation.

P.S: Sorry about the types naming. 🙈

alecklandgraf commented 6 years ago

@jukben should be all set now! Thanks for the review!

jukben commented 6 years ago

Thanks! Let's merge this. 🚀

alecklandgraf commented 6 years ago

@jukben I think you'll have to merge, let me know if you want me to rebase.

image

jukben commented 6 years ago

@alecklandgraf I know, I just wanted to sound epic ... and I've accidentally forgotten to click the merge button 🤣

Published as @webscopeio/react-textarea-autocomplete 2.1.0 🚀