We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c8aa88 commit cb97e58Copy full SHA for cb97e58
src/typeahead/dataset.js
@@ -319,9 +319,14 @@ var Dataset = (function() {
319
pending: templates.pending && _.templatify(templates.pending),
320
header: templates.header && _.templatify(templates.header),
321
footer: templates.footer && _.templatify(templates.footer),
322
- suggestion: templates.suggestion || suggestionTemplate
+ suggestion: templates.suggestion ? userSuggestionTemplate : suggestionTemplate
323
};
324
325
+ function userSuggestionTemplate(context) {
326
+ var template = templates.suggestion;
327
+ return $(template(context)).attr("id", _.guid());
328
+ }
329
+
330
function suggestionTemplate(context) {
331
return $('<div role="option">').attr('id', _.guid()).text(displayFn(context));
332
}
0 commit comments