awesomplete
awesomplete copied to clipboard
Empty suggestion list event callback or similar (when no results are found)
I'm working on a feature that a client requested, which is to show a message saying something on the lines of "No results found" when typing in the text box and no matches are found.
Is there any way that this is possible currently? If no, would it be possible to implement?
Thanks
+1 for this also: when the search takes long: a loading message
I came across this too for a list generated via an ajax request - here is my workaround.
To show a message for when No matches are found, create an item with the search term in the label - e.g. if the search term is "searchTermThatProducesNoResults" then create an item as follows and inject it into the list.
[ { label: "No matches found for searchTermThatProducesNoResults.", value: "" } ]
@neerajkamdar this doesn't work/apply when using a <datalist>
element instead of dynamically inserting the items through javascript.
I still think there should be a better way to do this.
@alandeg I agree. My workaround only works for lists generated dynamically.
+1 - It should be in the options on setup I think
I don't currently have time to implement a setting for this, but would welcome a PR :)