JQuery typeahead.js not returning all results.

Status: Resolved

Issue: I am using JQuery typeahead.js and the result only display the top 8 items.

Solution: I added in a line of code maxItem: Infinity after the “source:” block, and typeahead displays all of the results.

$('.your-control').typeahead({
    minLength: 2,
    dynamic: true,
    delay: 500,
    order: 'asc'
    source: {
        //Your data API calls, JSON, etc...
    }
    maxItem: Infinity //Display all results
});

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s