Skip to content

v6.0.0

Compare
Choose a tag to compare
@moroshko moroshko released this 27 Aug 12:23
· 190 commits to master since this release

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.

Fixed: #225, #226, #228