Autocomplete
Autocomplete provides options to configure how the filter search behaves
Props:
disabled
boolean
disables input
false
filterOptions
AutocompleteFilterOptions
*note this will set matchSorter
to never
Options to configure how the filter search behaves *cannot be included with matchSorter
undefined
freeSolo
boolean
Option to allow custom user input that doesn't match any of the supplied selectable options
false
label
string
Label associated with component
undefined
loading
boolean
If true
, displays component in 'loading' state
false
matchSorter
AutocompleteMatchSorterOptions
*note this will set filterOptions
to never
Options to use with our implementation of match-sorter *cannot be included with filterOptions
undefined
onChange
void
Callback handler triggered if typed input is received
undefined
onSelect
void
Callback handler triggered if drop down value is selected
undefined
options
AutocompleteOption[]
Array of AutocompleteOption objects these object have the properties of label: string
and value: string
List of selectable options
undefined
tooltip
string
Tooltip associated with component
undefined
validationError
string
Red message when input is invalid
undefined
value
string
Default selected value
undefined
filterOptions
and matchSorter
can't be used together; if you include both, the Loop will not build.
AutocompleteMatchSorterOptions
keepDiacritics
By default, match-sorter will strip diacritics before doing any comparisons. You can use this option to disable this behavior.
false
recipe
By default, match-sorter assumes spaces to be the word separator. However, you can use this option with the CaseTypes
enum to choose a different casing style.
threshold
Thresholds can be used to specify the criteria used to rank the results. Available thresholds are in the MatchSorterRankings
enum.
AutocompleteFilterOptions:
ignoreAccents
Defaults to true
. Remove diacritics.
true
ignoreCase
Defaults to true
. Ignores casing of searched text when comparing values.
true
limit
Default to null.
Limit the number of suggested options to be shown. For example, if config.limit
is 100, only the first 100 matching options are shown.
It can be useful if a lot of options match and virtualization wasn't set up.
null
matchFrom
Controls the matching starting position
'any'
stringify
Controls how an option is converted into a string so that it can be matched against the input text fragment. Accepts an array of strings that is the path to the key in the AutocompleteOption
to be used.
trim
Defaults to false. Remove trailing spaces.
false
Examples:
Last updated