i-like-robots/react-tags

Suggestions based on a function

ayberkcanturk opened this issue · 2 comments

Describe the solution you'd like

I am trying to achieve that I would like to use this component with suggestions feature where I can use a HTTP API to get the suggestions from.

It would be great if we were able to use a new props called suggestionsFunction which will pass the entered text to the function. This would by pass suggestions, suggestionsFilter and suggestionsTransform props but it would be handy to have to filter suggestions with a help of a function.

Describe alternatives you've considered

Additional context

It's possible to fetch suggestions asynchronously as the component implementing this one is already in control. Here is an example of fetching suggestions from an API with fetch: https://github.com/i-like-robots/react-tags/blob/async-fetch-example/example/main.js

@i-like-robots That's great, thank you.