dropdown autocomplete for input elements
$ component-install stagas/autocomplete
Inherits all methods from Dropdown and Menu.
Attach autocomplete to an input element.
Set the maximum number of visible items.
With a default set:
var autocomplete = require('autocomplete')
var ac = autocomplete(input, ["One", "Two", "Three"])
Using async results:
autocomplete(input, function (str, callback) {
someAsyncRequest(str, function (results) {
callback(results)
})
})
Both:
autocomplete(input, ["One", "Two", "Three"], function (str, callback) {
someAsyncRequest(str, function (results) {
callback(results)
})
})
MIT