vue-tagsinput icon indicating copy to clipboard operation
vue-tagsinput copied to clipboard

Is it possible to add tags on paste?

Open mattWalters0 opened this issue 4 years ago • 2 comments

So the tag would created as soon as you paste the text without having to hit enter.

mattWalters0 avatar May 25 '20 13:05 mattWalters0

i am looking for this function too, because our users often copy and paste content.

takeAction avatar May 26 '20 02:05 takeAction

I have achieved this behavior using @tag-added event and the following handler.

@tag-added="parseKeywords"

parseKeywords: function (keyword) {
            let val = keyword.value;
            if (val.indexOf(',') !== -1 || val.indexOf(';') !== -1) {
                this.selected.keywords.pop();
                val.split(/[,;]/).forEach(val => {
                    let found = this.selected.keywords.some(el => el.value === val);
                    if (!found && val.trim().length > 0) {
                        this.selected.keywords.push({key:'', value: val})
                    }

                })
            }
        }

kbeat avatar Jun 01 '20 13:06 kbeat