question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow onSearch to query empty string

See original GitHub issue

As 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:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sirzeratorcommented, May 14, 2018

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)".

0reactions
sagalbotcommented, Apr 15, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found