vuesion / vuesion

Vuesion is a boilerplate that empowers product teams to build faster with modern best practices across engineering and design. It features a full-stack framework, comprehensive design system, robust testing, and seamless internationalization.

Home Page:https://vuesion.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VueSelect (vue-select) does not update selected state when v-model changes

fyllepo opened this issue · comments

Describe the bug
VueSelect does not update selected option upon v-model change

(next branch)

To Reproduce
Steps to reproduce the behavior:

<vue-select
   ...omittted
   :items="options.year"
   v-model="selectedYear"
</vue-select>

export default defineComponent({
  setup() {
    let selectedYear = ref(2019);

    setTimeout(() => {
      selectedYear.value = 2017;
    }, 6000);

    return { selectedYear };
  }
})

Expected behavior
For a new option to be selected from the list upon v-model matching a different value

Work around, probably won't work with multi-select
Line 26, to remove the "isSelected" call.
<option v-for="(option, idx) in items" :key="idx" :value="option.value" :selected="value === option.value">