dropdown autocomplete for input elements
JavaScript Makefile
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
Makefile
README.md
component.json
index.js

README.md

autocomplete

dropdown autocomplete for input elements

Installing

$ component-install stagas/autocomplete

API

Inherits all methods from Dropdown and Menu.

Autocomplete(input, [items], [asyncFn])

Attach autocomplete to an input element.

Autocomplete.maxItems(n:Number)

Set the maximum number of visible items.

Usage

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)
  })
})

License

MIT