awesomplete icon indicating copy to clipboard operation
awesomplete copied to clipboard

Empty suggestion list event callback or similar (when no results are found)

Open alandeg opened this issue 7 years ago • 6 comments

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

alandeg avatar Dec 12 '16 11:12 alandeg

+1 for this also: when the search takes long: a loading message

El4a avatar Dec 21 '16 10:12 El4a

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 avatar Feb 10 '17 14:02 neerajkamdar

@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 avatar Feb 16 '17 15:02 alandeg

@alandeg I agree. My workaround only works for lists generated dynamically.

neerajkamdar avatar Feb 27 '17 06:02 neerajkamdar

+1 - It should be in the options on setup I think

Jetski5822 avatar Dec 30 '18 09:12 Jetski5822

I don't currently have time to implement a setting for this, but would welcome a PR :)

LeaVerou avatar Dec 30 '18 16:12 LeaVerou