-
Notifications
You must be signed in to change notification settings - Fork 74
Description
I'm submitting a ...
- bug report
- feature request
- support request
What is the current behavior?
When empty list is returned by query, then "not found" is not handled properly.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
- open https://kazanexpress.github.io/vue-simple-suggest/
- type "adfasdfasdf"
- you will see a line appearing below input (empty dropdown is show).
What is the expected behavior?
One way to handle it:
Create a special slot "no-results" - then user can handle it (pass "query" to this slot as well)
At moment you have this layout:
- miscItemAbove
-
suggestItems - miscItemBelow
...and question is how to hande "no-results" layout.
I prefer this, because header and footer are usually about results, no-result is handled differently:
With results:
- miscItemAbove
-
suggestItems - miscItemBelow
Without results: - no-results slot
If "no-results" slot is not defined by user, then hide dropdown completly.
For example, for hidding dropdown use
computed:
hasNoResultsSlot () {
return !!this.$scopedSlots['no-results'];
}
PS. Please use same convention for slot names - camelCase or kebab-case, not mixed.
Its hard to remember, was it miscItem-above or miscItem-Above or miscItem-Above or misc-ItemAbove. (Maybe rename them: results-header and results-footer)