Releases: moroshko/react-autosuggest
Releases · moroshko/react-autosuggest
v7.0.1
v7.0.0
v6.1.0
Added inputComponent
v6.0.4
v6.0.3
v6.0.2
v6.0.1
v6.0.0
Breaking change: onSuggestionsUpdateRequested
was replaced with onSuggestionsFetchRequested
and onSuggestionsClearRequested
.
- onSuggestionsUpdateRequested = ({ value, reason }) => {
+ onSuggestionsFetchRequested = ({ value }) => { // `reason` is not exposed anymore
this.setState({
suggestions: getSuggestions(value)
});
};
+ onSuggestionsClearRequested = () => {
+ this.setState({
+ suggestions: []
+ });
+ };
<Autosuggest
- onSuggestionsUpdateRequested={this.onSuggestionsUpdateRequested}
+ onSuggestionsFetchRequested={this.onSuggestionsUpdateRequested}
+ onSuggestionsClearRequested={this.onSuggestionsClearRequested}
...
/>
onSuggestionsFetchRequested
is very similar to onSuggestionsUpdateRequested
, except that it doesn't expose reason
anymore.
onSuggestionsClearRequested
must be specified (unless you set alwaysRenderSuggestions={true}
), and all it has to do is to set suggestions
to an empty array.