react-typeahead-component
react-typeahead-component copied to clipboard
Support for tags
It would be cool if you could do multiple queries for a given input, and have queries saved as tags in the input field.
Something similar to this: https://github.com/olahol/react-tagsinput
Have you thought about adding something like this?
We actually did implement this, but instead as a higher-order component which used Typeahead. This was done to keep the reusability of Typeahead extremely high, e.g. there were cases where we didn't need tags/tokens. We didn't end up releasing it though. The basic skeleton went something like:
var TokenizedTypeahead = React.createClass({
render: function() {
return (
<div>
{this.renderTokens()}
<Typeahead
onKeyDown={function(e) {
if (e.key === 'Tab') {
this.createToken()
}
}}
/>
</div>
);
}
});