v29.17.0
Minor Changes
-
Autosuggest: Add
filterSuggestionsfunction, allowsuggestionsprop to be a function (#831)The logic for filtering suggestions typically lives on the server rather than the client because it’s impractical to send all possible suggestions over the network. However, when prototyping in Playroom or working with smaller datasets, you may want to perform this filtering on the client instead. For this case, we now provide a
filterSuggestionsfunction to make this as painless as possible.To better support this behaviour, you can now pass a function to the
suggestionsprop. When executed, this function will be passed the currentvalueof the field.EXAMPLE USAGE
import { Autosuggest, filterSuggestions } from 'braid-design-system'; <Autosuggest suggestions={filterSuggestions([ { text: 'Apples', value: 1 }, { text: 'Bananas', value: 2 }, ])} {...restProps} />;