-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No option to show all prefetched data on click without typing any in to textbox #44
Comments
Hi @NipunaMarcus, I've been able to successfully show suggestions onClick by using the
|
Hi @jlbooker Thank you for the reply .... Actually in my case it is not possible for me to have second source since the data in the source is dynamic ... So i cannot have a default set of suggestions ... So what i did was just added a new flag called "showAll: true" to the property list of typeahead .. If this flag is true then onFocus or onClick All the available data will be loaded in to the dropdown and a scroller will be available if there is a overflow. ... Thank you again .... |
I'm also having this issue and it's driving me insane... Shouldn't typeahead/bloodhound return all results by default when the |
I fixed this by editing out the library ... i didn't send a PR because not sure that is the correct way to archive it ... but here is my fix to the typeahead[1], please read ahead from this point and how i used it to show all records[2] |
@NipunaMarcus Feel free to open a PR and we'll have a look! |
Sure.. will do |
Hey @NipunaMarcus, I extracted your solution: if (!query) {
matches = [];
for (var obj in that.datums) {
matches.push(obj);
}
} And it worked great! Did you ever get around to creating a PR for this? If not, I can go ahead and do it for you so that others can benefit from this. |
This allows you to set `minLength: 0` and get default values back when a query is run. This is a PR of @NipunaMarcus's work in this Issue: corejavascript#44 Will likely need to update the dist version as well. But hoping to get some 👀 on this and get it merged in so we can use the main branch in our app.
FYI, I went ahead and created a simple PR with @NipunaMarcus's suggested change to the bloodhound.js file: #214 Please review it and see what else needs to be done to it. |
@joshuapinter thank you for opening a PR :D ... |
Any update on this? We're running into this issue as well. |
I'm not sure this could ever be accepted. Typeahead can rely on one (or more) back-end data sources. If the only data source is a remote source (i.e. a ajax call to an endpoint) then showing all results with a scroll list could have a very negative performance impact. It's conceivable that the full remote data set may not be available, or may not be something we want to send over the network (if, for example, the data source is backed by a database with thousands/hundreds of thousands of results). This only works if your dataset is relatively small, but that assumption is not one we can safely make for all users of TypeAhead. I would refer you to my earlier example, with a bit more explanation:
|
It's also important to set |
I tried to do this with your Default Suggestions example, but in my case data set is dynamic. Because of that this is not suitable. Also some users may have no idea what to type in textbox to load the suggestions... Sometimes user have to try inputting A to Z to get a suggestion..
The text was updated successfully, but these errors were encountered: