vue-input-tag icon indicating copy to clipboard operation
vue-input-tag copied to clipboard

Can you add autocomplete function?

Open tolerious opened this issue 7 years ago • 22 comments

2016-11-25 1 38 16

such as this, get the prompt data from backend.

tolerious avatar Nov 25 '16 05:11 tolerious

Hi! I still have to finish some stuff and be sure that the component is stable. Once I finish with that I would like to implement this. Thanks for the suggestion.

matiastucci avatar Nov 25 '16 05:11 matiastucci

THX, I am using your component in my project.

tolerious avatar Nov 25 '16 05:11 tolerious

Can I suggest to leave this issue open to keep track of the work for autocomplete?

HectorMalot avatar Mar 18 '17 13:03 HectorMalot

further to autocomplete it would be nice if validators can talk to a backend. e.g imagine tags being products codes and a validator being able to talk to the backend using an axios/ajax call and return trey or false if the product exists or not.

nice work on this component.

unitedworx avatar Mar 23 '17 05:03 unitedworx

Hi. Thanks for your work on this component. I also wanted an autocomplete functionality but i would like to compose a custom component with this one to achieve the same. However, i need a callback on the event of input change, so that i can use the partial input text to generate a list of autocomplete options. Can i send a pull-request for this change? Should be very simple.

pdey avatar Jun 26 '17 12:06 pdey

sure :)

matiastucci avatar Jun 26 '17 12:06 matiastucci

Autocomplete / callback on-change functionality would be super cool 👍

richlove1 avatar Jul 03 '17 16:07 richlove1

Basically just need a @keyup functionality for this right? Then make a http call to your tag db or other source of tag data (maybe in Vuex).

https://gist.github.com/EvanZ/13d3d7dd4d29e9ab39ad39ffa8dcfef8

EvanZ avatar Aug 04 '17 18:08 EvanZ

I might make a fork of this to work on this since I require it for a project but don't wish to reinvent the wheel.

Also since its just used for tags I don't think an http call is required since most of the time you are just checking if tags exist. maybe just pass it an array like the pre filled ones then checking if the value exists in array if so suggest it, to start with at least.

michaelmano avatar Sep 14 '17 23:09 michaelmano

@michaelmano think of tags being products codes and products being tens of thousands, does not make sense to give it an array of thousands of valid product codes but make much sense to make an Ajax call to validate if the code exists! if the validation is implemented in some sort of function callback then its up to you to simply check an array or make an Ajax call depending on your needs!

unitedworx avatar Sep 15 '17 14:09 unitedworx

@unitedworx then maybe have either option. An auto complete array for smaller things and an auto complete URL that will post with a denounce function to get an array

michaelmano avatar Sep 15 '17 14:09 michaelmano

Autocomplete is must have feature, please consider to add it.

hackuun avatar Feb 21 '18 09:02 hackuun

Mmmmh this component is really useful. Too bad it's not 100% finished, it lacks a few methods you don't seem to be willing to implement I guess I'll have to do it on my own ^^'

LorrainInfinity avatar Feb 21 '18 14:02 LorrainInfinity

@LorrainInfinity Sometimes is really hard to make enough time to maintain an open source project but PR's are welcome 😉

ianaya89 avatar Feb 21 '18 14:02 ianaya89

@ianaya89 Yes that's true ^^. It doesn't lack much and I think it could be useful enough to a lot of people but I'm trying to use it for a very complex architecture so I'll have to improve it a bit :p

LorrainInfinity avatar Feb 21 '18 14:02 LorrainInfinity

@LorrainInfinity besides this feature, what else is missing in your opinion?

matiastucci avatar Feb 21 '18 14:02 matiastucci

It'd be great to be able to detect which element was deleted. I know you did add a update:tags method (btw you should add it on the home page of the git project so people know about it :p). But I need to know exactly what element is removed from the array of elements.

On another hand it'd be great to be able to pass an array of objects as tags, and if so, add a "track-by" prop so it tracks based on a specific key. That's because I need to create an array of strings instead of using my real array of objects.

And why not fancy props like background-colors, colors etc to fit people's design but as I said, that's just fancy stuff :p

LorrainInfinity avatar Feb 21 '18 14:02 LorrainInfinity

@LorrainInfinity You might check out Vuetify which pretty much has all these features in their multi-select. https://vuetifyjs.com/en/components/selects#api

EvanZ avatar Feb 21 '18 16:02 EvanZ

Mmh yes maybe it could work but what I really need here is a tag creator not a multiselect (even though I saw that there is a "tag" option to allow tag creation, but in the end, it'll still be a select list isn't it?).

Anyway thank you for the component I'll look into that :)

LorrainInfinity avatar Feb 22 '18 07:02 LorrainInfinity

You can use it as a multi-select but also add new tags. Overall, I'm very hapy with vuetify. You can see I use it for my site: https://catapolt.co.

EvanZ avatar Feb 22 '18 18:02 EvanZ

Yea this feature will be very useful.

tomaytotomato avatar Mar 15 '18 16:03 tomaytotomato

I have added this PR to allow implement autocomplete out of the component: https://github.com/matiastucci/vue-input-tag/pull/63

demonodojo avatar Apr 06 '18 11:04 demonodojo