8000 What is wrong in my vueMultiSelect · Issue #583 · vue-generators/vue-form-generator · GitHub
[go: up one dir, main page]

Skip to content

What is wrong in my vueMultiSelect #583

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

Closed
a21ns1g4ts opened this issue Jan 29, 2019 · 4 comments
Closed

What is wrong in my vueMultiSelect #583

a21ns1g4ts opened this issue Jan 29, 2019 · 4 comments

Comments

@a21ns1g4ts
Copy link
a21ns1g4ts commented Jan 29, 2019

When i try remove the tag added in my multi select the options multiplies in my input automaticaly.
I get this reference in doc-site
image

{
    type: "vueMultiSelect",
    model: "cid10",
    label: "cid10",
    placeholder: "Busque uma doença",
    required: true,
    validator: VueFormGenerator.validators.required,
    selectOptions: {
        multiple: true,
        key: "code",
        label: "name",
        searchable: true,
        taggable: true,
        tagPlaceholder: "Adicione o código",
        onNewTag: function(newTag, id, options, value) {
            const tag = {
                name: newTag,
                code: newTag.substring(0,2) + Math.floor((Math.random() * 10000000))
            };
            options.push(tag);
            value.push(tag);
        }
    },
    onChanged: function(model,newVal,oldVal,field) {
        console.log('@tag:', newVal);
    },
    values: [

    ]
}
@a21ns1g4ts a21ns1g4ts changed the title Bug in vueMultiSelect What is wrong in my vueMultiSelect Jan 30, 2019
@chris-jones
Copy link

@Atiladanvi Did you find your solution?

I had a similar issue that was related to the version of Vue-Multiselect I was using (i.e. the latest version) however, downgrading to an earlier version (2.0.0-beta) fixes the issue but brings about another issue. There seems to be an incompatibility issue between the beta version of vue-multiselect and the latest vue-generator though.

@a21ns1g4ts
Copy link
Author

Post your code.

@chris-jones
Copy link

I've actually found out the solution and I think the documentation needs updating, but in essence, the property "trackBy" needs to be added to selectOptions, when using JSON objects as values.

@a21ns1g4ts
Copy link
Author

You can submit a pull request about that.

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

2 participants
0