Typeahead.js / Bloodhound display just one result [duplicate]

╄→гoц情女王★ 提交于 2019-11-30 14:35:56
Dr. Gianluigi Zane Zanettini

This is to confirm that the issue is caused by this typehaead bug: https://github.com/twitter/typeahead.js/issues/1218

As suggested by joekur in the issue report, I solved replacing this:

rendered += suggestions.length;
that._append(query, suggestions.slice(0, that.limit - rendered));

With this:

suggestions = suggestions.slice(0, that.limit - rendered);
rendered += suggestions.length;
that._append(query, suggestions);

I marked my own question as duplicate of this: TypeAhead.js and Bloodhound showing an odd number of results It's the same problem, I just cannot find it before due to different wording

HTH.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!