Bootstrap Typeahead not showing hints as expected

后端 未结 3 2051
青春惊慌失措
青春惊慌失措 2020-12-10 07:18

I\'m using Typeahead to show hints from an items database and a stores database. When I show hints only from items it shows fine, when I show only from stores works fine too

3条回答
  •  青春惊慌失措
    2020-12-10 07:55

    @Luciano Garcia Bes - to complete your anwser, below I've post all changes which are needed : you have rigth to switch those lines, but I need remove - rendered too. So finally It sholud looks like this (whole function):

                function async(suggestions) {
                    suggestions = suggestions || [];
                    if (!canceled && rendered < that.limit) {
                        that.cancel = $.noop;
                        that._append(query, suggestions.slice(0, that.limit));
                        rendered += suggestions.length;
                        that.async && that.trigger("asyncReceived", query);
                    }
                }
    

    more about this iisue : https://github.com/twitter/typeahead.js/issues/1415

提交回复
热议问题