Looks like the CSS isn't working for my Typeahead. I am trying to reproduce the Scrollable Dropdown Menu like on https://twitter.github.io/typeahead.js/examples
Here is my code:
JS
var productList = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('PART_NO'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
//Maybe I need a prefetch
// prefetch: '../data/films/post_1960.json',
remote: {
url: 'getProducts/%QUERY',
wildcard: '%QUERY'
}
});
$('#scrollable-dropdown-menu .typeahead').typeahead(null, {
name: 'PARTS',
limit: 10,
display: 'PART_NO',
source: productList
});
CSS
#scrollable-dropdown-menu .tt-dropdown-menu {
max-height: 150px;
overflow-y: auto;
background-color: red;
}
I can't see where the .tt-dropdown-menu is?
Cheers,
Mick
See this GitHub issue. There is an issue with the scrollable dropdown example.
Update your CSS to:
#scrollable-dropdown-menu .tt-menu {
max-height: 150px;
overflow-y: auto;
background-color: red;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With