typeahead
typeahead widget
use
var Typeahead = require('typeahead');
var input = document.createElement('input');
// source is an array of items
var ta = Typeahead(input, {
source: ['foo', 'bar', 'baz']
});
input // =>
To get the default style you also have to include
style.css
.options
source
array of values or function(query, result). Call result with array of return values.
var Typeahead = require('typeahead');
var input = document.createElement('input');
// source is an array of items
var ta = Typeahead(input, {
source: function(query, result) {
result(['foo', 'bar', 'baz']);
}
});
input // =>
position
location of the drop down menu. Valid values are ``above
`,
`below
`and
`right
`. default is
`below
``
autoselect
Automatically select first item in drop down menu. Valid values are ``true
`,
`false
`. Default is
`true
``.