-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct way perform query programmatically? #52
Comments
It would be better for vue-autosuggest to have a prop that controls this, as right now there is an internal state variable called "loading" that I'm using. Until then, you could override it's default value which is true in the mounted lifecycle: mounted(){
this.$refs.autocomplete.loading = false
this.fetchResults('singapore')
} Thanks for the feedback! |
I am interested in this topic as well. I found today I had used the same approach of triggering a click event. Regarding a potential enhancement, are suggesting a boolean prop that shows/hides suggestions and can be toggled from the outside? Originally I had though perhaps just exposing a method via ref would work, but the prop approach mitigates more $ref usage, which is ideal. |
@scottadamsmith IMO an even better enhancement would be to introduce the idea of a stateReducer. Taking inspiration from https://github.com/paypal/downshift#statereducer, we could give users ability to override data values without needing to use "control props". |
I manage to perform query programmatically using the following code, was wondering is this the best way to do it? (especially trigger the search UI to popup)
The code is based on this sample: https://codesandbox.io/s/mjqrk7v2rx
The text was updated successfully, but these errors were encountered: