Description
Vue version
>= 3.4.15
Link to minimal reproduction
https://codepen.io/axllent/pen/KKYmZEq
Steps to reproduce
Please see the reproduction link. Since 3.4.15 all HTML multiselect options are only preselected if the data array values are strings. Integer array values are now ignored and not matched to their string "counterparts".
What is expected?
In the following example the multiselect form field have pre-selected values (Vue <= 3.4.14): https://codepen.io/axllent/pen/YzMVxvb
What is actually happening?
It seems Vue disregards the original model values due to the int -> string type change. This is a change in behaviour to all previous versions of Vue, and differs in behaviour to single select fields which continue to work as expected (eg: integer value 2
is matched correctly to <option value="2">Two</option>
).
System Info
N/A - impacts Firefox & Chrome on Linux, Mac and Windows.
Any additional comments?
Vue has always had a relaxed integer -> string relationship regarding selected values in forms, given that all form select values are in fact strings (eg: <option value="2">Two</option>
).
I have worked out that this regression was introduced in 3.4.15, and I suspect via commit v-model: optimize v-model multiple select w/ large lists (2ffb956).