Tiny react input component with autocomplete.
Tiny react input component with HTML5-like autocomplete.
Because HTML5 autocomplete only show options based on earlier user typed values.
Live demo: kevinjhanna.github.io/input-autocomplete
npm install input-autocomplete --save
import { InputAutocomplete } from 'input-autocomplete'
<InputAutocomplete
type='text'
autocompleteValues={['john lennon', 'john travolta']}
/>
import { InputAutocomplete } from 'input-autocomplete'
let state = {
name: ''
}
const handleOnChange = (ev) => {
state = {
name: ev.currentTarget.value
}
}
<InputAutocomplete
type='text'
autocompleteValues={['john lennon', 'john travolta']}
value={state.name}
onChange={handleOnChange}
/>