alexurquhart / vue-bootstrap-typeahead

An autocomplete/typeahead component for Vue 2 and Bootstrap 4
https://alexurquhart.github.io/vue-bootstrap-typeahead/
MIT License
206 stars 157 forks source link

It is possible to show autosuggestions list after user click in show input? #56

Open jakubstankowski opened 5 years ago

jakubstankowski commented 5 years ago

Hi!

I have question - it is possible to show suggestions list after user click in input ? I mean something like google, show list only click in input

thanks for answer!

marcboule98 commented 5 years ago

Yes, it's possible.

You can save all your result on one array, and in the data prop, put and empty array. Then you trigger your click event on whatever you want, and equals the empty array to your original array with all your results.

<vue-bootstrap-typeahead :data="emptyArray"></vue-bootstrap-typeahead> triggerMethod: function(){ this.emptyArray = this.originalArray; }

I think this is what you want :)

jakubstankowski commented 5 years ago

it's not working

mattzollinhofer commented 4 years ago

I merged a fix for this into my fork (https://github.com/mattzollinhofer/vue-typeahead-bootstrap) of this project that I'm actively maintaining.

You can find it on npm here: https://www.npmjs.com/package/vue-typeahead-bootstrap.

I hope this helps!