[form-select] Cannot set value when return-object="true"
See original GitHub issueIt appears that one cannot set the v-model value when return-object
is true
.
https://jsfiddle.net/bootstrapvue/osty8mc8/
localvalue
(inside b-form-select
) expects to be the value
field of the option(s), but the watcher for value
, blindly passes the v-model value to localvalue
, which is not what should be expected.
Does anyone actually use the return-object
feature? Trying to get it to work on a two-way v-model might be a bit of code overhead,
When not in return-object
mode, it is also possible to programmatically select a disabled
option (which should not be allowed)
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
react-select not updating selected value on initial select
value type must be the same as the first argument of onChange callback: value={region} onChange={(item) => { console.log(item); // set item ...
Read more >[Solved]-Vuetify autocomplete component: set value-Vue.js
Following snippet worked for me: <v-autocomplete [...] :filter="filter" :return-object="true" > <template slot="selection" slot-scope="data"> ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ended up with something like the code below, which sounds similar to what you describe. This solution works, seems simple, and is probably best left to the developer. The component’s default input event works fine for simple types, but for objects, this seems reasonable and gets me an object back in v-model. The options array is a computed property, so can be customized as needed.
I would just use vue-select then apply the same css classes that vue-bootstrap applies. vue-select easily handles objects so i dont know why <b-form-select> can’t.