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

createOption is not creating an object #1156

Closed
edalzell opened this issue Apr 10, 2020 · 4 comments · Fixed by #1158
Closed

createOption is not creating an object #1156

edalzell opened this issue Apr 10, 2020 · 4 comments · Fixed by #1158
Assignees
Labels
bug released tagging Relates to the `taggable` prop

Comments

@edalzell
Copy link

Describe the bug
When using createOption in 3.9.5 like this:

                                <v-select
                                    label="name"
                                    :options="foo"
                                    v-model="organization"
                                    taggable
                                    :create-option="org => ({ name: org})"
                                    id="newOrg"
                                >

organization is getting saved as a string and not an object.
To Reproduce
Steps to reproduce the behavior:

  1. Try a vue-select:
                                <v-select
                                    label="name"
                                    :options="foo"
                                    v-model="organization"
                                    taggable
                                    :create-option="org => ({ name: org})"
                                    id="newOrg"
                                >
  1. See the value of organization when you create a new one.

Expected behavior

organization: {
  name: "new org"
@sagalbot sagalbot added bug tagging Relates to the `taggable` prop labels Apr 10, 2020
@sagalbot sagalbot self-assigned this Apr 10, 2020
@sagalbot
Copy link
Owner

That's a bug for sure. Reproduction here: https://codepen.io/sagalbot/pen/mdeyRGX?editors=1010

Will take a look today.

@github-actions
Copy link

🎉 This issue has been resolved in version 3.9.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@edalzell
Copy link
Author

Sweet, thanks!

@mrkazmierczak
Copy link

I'm so confused, why good vue packages has so shitty documentation. I'm trying to find out, how to dynamically add value to the vue-select component without reloading whole page... and nothing. The documentation should be written by someone else than author... I have a situation when I have a form with vue select and button which fire modal window with form where I can add new option. After add this option I emited new value. I was searching for a solution where I can add this value to options of this vue-select, not whole page and nothing... This is rudimental functionality for reactive forms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug released tagging Relates to the `taggable` prop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants