Multiple Select Initialization
Version
3.0.5
Reproduction link
https://codesandbox.io/s/modest-cannon-7qoku?file=/src/App.vue
Steps to reproduce
- Create select with few different options.
- Add 'multiple' attr to select.
- Add 'selected' attr to few select options.
- Just update the page
What is expected?
All selected options are chosen
What is actually happening?
Only last select option is chosen
You can use v-model until this gets fixed, https://codesandbox.io/s/angry-sound-ljjte?file=/src/App.vue
@HcySunYang Thank you! But unfortunately we need described behavoure. We have pretty big app with tons of legacy code, so then we mount vue into our main wrapper, it breaks all <select multiple >
everywhere in the legacy part
The children
are patched before props
, which is necessary for <select value>
, but the opposite is true for <select multiple>
. In vue2, we take that as a special case https://github.com/vuejs/vue/blob/dev/src/platforms/web/runtime/node-ops.js#L7-L13, and this PR(https://github.com/vuejs/vue-next/pull/3202) respects this behavior