Skip to content
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

Is it possible to add tags on paste? #97

Open
mattWalters0 opened this issue May 25, 2020 · 2 comments
Open

Is it possible to add tags on paste? #97

mattWalters0 opened this issue May 25, 2020 · 2 comments

Comments

@mattWalters0
Copy link

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

@takeAction
Copy link

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

@kbeat
Copy link

kbeat commented Jun 1, 2020

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})
                    }

                })
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants