React Autocomplete Component
npm install dml-react-autocompletebapmrl-react-autocomplete is a javascript library, greatly inspired from react-typeahead, that provides a
simple React Autocomplete Component.
``javascript
import Autocomplete from 'bapmrl-react-autocomplete';
input => Promise.resolve(
input.split().map((w, index) => { return { key: index, label: w }; })
)
}
onOptionSelected={option => { window.alert(option.label); }}
ref="autocomplete" />
`
#### props.classNames
Type: Objectautocomplete
Allowed Keys: , input, options, option, optionHover
An object containing custom class names for child elements.
#### props.inputProps
Type: Object
Props to pass directly to the element.
#### props.maxVisible
Type: Number
Limit the number of elements rendered in the options list.
#### props.onOptionSelected
Type: Function
Event handler triggered whenever a user picks an option.
#### props.onValueChange
Type: Function
Event handler for the change event on the Autocomplete element.
#### props.options
Type: Function
A function that returns for a given Autocomplete input value a Promise for anArray of Option objects. An Option object must have a React key, alabel and may carry additional payload.
#### props.wait
Type: Number
Default: 250
The number of milliseconds to throttle invocations to the options function.
Type: Function
Returns the Autocomplete input value.
Type: Function
Returns the selected Option. If the user has picked an option but then changesnull
the Autocomplete input value this function will return .
Type: Function
Returns true when an option is hovered and false` otherwise.