Check nout the following code. I have pasted HTML, JavaScript and CSS separately.
HTML Code
<html>
<body class="yui3-skin-sam">
<div class="line">
<div id="invoice-customer-id">
<input type="text" value="x"/>
</div>
</div>
</body>
</html>
Java script
YUI().use('node', 'autocomplete', 'autocomplete-highlighters', 'autocomplete-filters', function (Y){
var node = Y.one('input'),
items = [0,1,2,3,4,5,6,7,8,9,'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'e', 'f'];
node.plug(Y.Plugin.AutoComplete, {
height: '100px',
minQueryLength: 0,
scrollIntoView: true,
circular: false,
resultHighlighter: 'phraseMatch',
resultFilters: 'phraseMatch',
source: items,
on : {
select : function(e) {
console.log(arguments); //TODO: update your code
}}
});
}); // end of javascript
CSS
.line {
overflow: hidden;
/* position: relative; */
}
.yui3-aclist-content {
overflow-y: auto;
}
#invoice-customer-id {
padding: 8% 0;
}