value must be in suggestions
Are you reporting a bug?
-
Please create a Codepen that demonstrates your issue. You can start from the Basic example.
-
Provide the steps to reproduce the issue, e.g.:
- Focus on the input field and type something
- tab out
Observed behaviour: the value stays in the input even though it is not a valid suggestion
Expected behaviour: either a suggestion is chosen from the suggestions array or the value is cleared.
Are you making a feature request?
Would love to see an example of this. I have been trying to achieve this in onSuggestionsClearRequested and handleBlur but can somehow not figure it out...
-
If you have ideas how to extend the Autosuggest API to support your new feature, please share! a bool maybe,
suggestionsOnlyor so? -
If you know any examples online that already implement such functionality, please share a link. just a normal select box e.g.
Autosuggest is not about constraining the value, it's about helping you to type faster. Have a look at react-select.
@moroshko First off, great work on this component. We're using Autosuggest because it provides a better accessibility experience than react-select, but we do at times need to constrain the value. That is, we'll probably be forking Autosuggest to add support for this--would you be averse to a PR that adds this functionality?