-
Notifications
You must be signed in to change notification settings - Fork 532
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
Vue-multiselect doesn't work properly with objects #159
Comments
Can you do a PR ? And maybe take a look at the test to update them ? Thank you very much ! |
Yes, will do a PR later on today. |
Thanks a lot ! |
cristijora
pushed a commit
to cristijora/vue-form-generator
that referenced
this issue
Mar 20, 2017
…o work with object values
icebob
added a commit
that referenced
this issue
Mar 20, 2017
#159 Vue-multiselect doesn't work properly with objects
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: vue-form-generator 2.0.0-beta.15
Scenario:
Copy pasted the example from https://icebob.gitbooks.io/vueformgenerator/content/fields/vuemultiselect.html (simple object select)
Result:
In the select list option I get the whole objects including their fields
Expected:
In the select list options I have only text values according to the
label
prop I have set.In this case, only
name
should be shown (Vue.js, Rails, Sinatra) just the same as in the official vue multi select docs. http://monterail.github.io/vue-multiselect/#sub-single-select-objectCause:
It seems that
customLabel
function from the fieldMultiSelect has some wrong logic in it:This bit
return function(currentLabel){return currentLabel;};
returns the whole object instead of returning the necessary label only. Also a specifiedcustomLabel
function doesn't work because of this checkthis.schema.selectOptions.customLabel === "function"
which has a missingtypeof
before it.Here is an alternative:
Since the vue-multiselect library has it's own way of handling default values why not pass an
undefined
to it when there is nocustomLabel
provided by the user and let the library handle it's stuff?The text was updated successfully, but these errors were encountered: