Allow onSearch to query empty string
See original GitHub issueAs in the code, the search function only triggers when the input string is not empty
https://github.com/sagalbot/vue-select/blob/master/src/mixins/ajax.js#L42
if (this.search.length > 0) {
this.onSearch(this.search, this.toggleLoading)
this.$emit('search', this.search, this.toggleLoading)
}
So when I enter a search query, then remove the query, it is stuck with the last letter, so I cannot query for all items anymore, thus no way to disable the search (the onSearch event does not fire at all).
Please remove this check or show a way to remove the entered search. Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:5 (3 by maintainers)
Top Results From Across the Web
why `location.search` contains `?` and an empty string when ...
1 Answer 1 · If this 's relevant Document is non- null and its origin is not same origin-domain with the entry settings...
Read more >Filter by null or missing attributes - Algolia
How to filter on records that don't contain the filter values.
Read more >Requiring query field to not be empty on search api
do search api endpoints typically allow you to search for nothing and just return empty. It is up to the implementors (and perhaps ......
Read more >Filters in Azure Cognitive Search - Microsoft Learn
When used alone (for example, when the query string is empty where search=* ), the filter criteria is the sole input.
Read more >When users leave the search box empty... - CSS-Tricks
Indeed, even the vast majority of industry-leading web design blogs seem to give no real consensus on what should or shouldn't happen!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I totally agree that this could be in the component itself. As a workaround, you can always use something like
v-on:keyup.native="someMethod($event)"
.Fixed in 3.0. The
onSearch
callback has been removed in favor of the@search
event, which is called anytime the string changes, regardless if it is null.