react-autosuggest icon indicating copy to clipboard operation
react-autosuggest copied to clipboard

value must be in suggestions

Open janusch opened this issue 9 years ago • 2 comments

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.:

    1. Focus on the input field and type something
    2. 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, suggestionsOnly or so?

  • If you know any examples online that already implement such functionality, please share a link. just a normal select box e.g.

janusch avatar Mar 24 '17 15:03 janusch

Autosuggest is not about constraining the value, it's about helping you to type faster. Have a look at react-select.

moroshko avatar Mar 25 '17 00:03 moroshko

@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?

somaholiday avatar Aug 01 '17 20:08 somaholiday