-
Notifications
You must be signed in to change notification settings - Fork 3.1k
typeahead not showing all results if less than limit #1232
Copy link
Copy link
Open
Description
I'm using typeahead with the following code:
$('#questionId .typeahead').typeahead(null, {
name: 'questions',
displayKey: 'question',
source: questionsList,
limit: 10,
templates: {
empty: '<p>message</p>',
suggestion: Handlebars.compile('<p>{{question}}</p>')
}
})Where 'questionsList' is a Bloodhound instance. The suggestions seem to be working fine when the query's number of matches is greater than 'limit' (10 in this case). But the problem is when the number of matches is <= limit. In that case, the number of suggestions displayed is max(limit - results, results). For instance, in my case when the query returns 10 matches, 0 results are displayed. When the query returns 8 matches, 2 results are displayed. When the query returns 3 matches, 3 results are displayed, and so on.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels