question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Returning objects as values from v-select (multiple) doesn't work

See original GitHub issue

Steps to reproduce

  1. Create a v-select with the multiple attribute and add items like { text: 'foo', value: { } } (objects as values)
  2. Select at least two items in the dropdown

Versions

Vuetify 0.14.1 Vue 2.4.1

What is expected ?

The value objects of the selected items should be returned in v-model. This works for me in 0.13.1.

What is actually happening ?

The selection is broken; null values are returned, checked items are not highlighted in the dropdown.

Reproduction Link

https://codepen.io/anon/pen/LLvwmJ

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

36reactions
jorr-itcommented, Dec 23, 2018

Already noted by John, but is a hint for future reference: the prop return-object did the trick for me.

17reactions
johnleidercommented, Jul 17, 2017

You were missing your item-value declaration. Since you are using a nested object for it. You were also missing the prop return-object to return the object as the response.

https://codepen.io/johnjleider/pen/jwoNrG

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML select multiple doesn't return an array - Stack Overflow
For a multi-select, .val() returns an array of the selected values, so .val()[1] is a string. .value is a property of input elements, ......
Read more >
Returning Multiple Values from a Function - JavaScript Tutorial
To return multiple values from a function, you can pack the return values as elements of an array or as properties of an...
Read more >
Selection and Range - The Modern JavaScript Tutorial
A Range object is created without parameters: let range = new Range();. Then we can set the selection boundaries using range.
Read more >
QuerySet API reference | Django documentation
Returns a new QuerySet containing objects that match the given lookup parameters. The lookup parameters ( **kwargs ) should be in the format...
Read more >
Select2 3.5.3
When placeholder is used for a non-multi-value select box, it requires that you ... data can also itself be a function that returns...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found