sagalbot / vue-select

Everything you wish the HTML <select> element could do, wrapped up into a lightweight, extensible Vue component.
https://vue-select.org
MIT License
4.63k stars 1.34k forks source link

vs__selected element does not appear on refresh/page change with simple :value set (v4 Beta) #1782

Open merlinstardust opened 1 year ago

merlinstardust commented 1 year ago

Please respect maintainers time by filling in these sections. Your issue will likely be closed without this information.

Describe the bug Even with a very basic setup, the vs__select element does not appear when changing the page or on app start.

Reproduction Link I built this repo fresh to show this bug

https://github.com/merlinstardust/vue-select-error/blob/main/src/components/TheWelcome.vue#L21

Steps To Reproduce Create a project and install vue-select beta

npm init vue@latest
npm i
npm install vue-select@beta
npm run format

Add these lines into the appropriate sections

const items = ['C5', 'C6', 'C7', 'C8']; // script section
<VueSelect class="custom-styles" :options="items" :value="'C7'" /> // template section

Expected behavior When starting the app, C7 should already be selected and this element's code should be in the DOM

<span class="vs__selected">C7<!----></span>

Screenshots As you can see in the screenshot, the containing div does show value="C7" but there is no span with vs__selected and C7 inside it.

Screenshot 2023-07-04 at 10 14 54
e1jo commented 9 months ago

same problem! Not transferable: :value

DEMO: codepen

Expected behavior DEMO (Vue version) : codepen

e1jo commented 9 months ago

UPDATE: I did research props inside select component and saw that we need to pass another prop: :modelValue insted :value This way it worked on my work project:)

petitkriket commented 7 months ago

legit issue, the v4 docs should be updated to reflect this change and point to modelValue (vue 3) instead of value (vue 2)