-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select box with v-model updates lazy when mounting the component #7392
Comments
The same happens with a checkbox. Value is set after control is added to the dom which triggers transition animations. |
@edikdeisling |
@edison1105 I was wrong and my problem is not relative to this issue. For some reason |
@edikdeisling |
It's probably something that can be optimized |
Vue version
3.2.45
Link to minimal reproduction
https://sfc.vuejs.org/#__SSR__eNqtVU1v2zAM/SuEL0mB2m7Xj4PnBOt62mlAO/Tki2PTiTpbEiQ5aVDkv4+SYtdpkyAdepPEx0fySaRegzspo2WLQRKkBhtZ5wanGQdIS7aEos61nmRBIbjJGUeVBc5I5sXldBk2osQaDGoDK2YW8NQiXMHj40Mak32LHBIxitFzkE1OH7HGwszEi2fYcqaxfANpB+lMxOIPsHzK6xYfsBowElxIwwSHpTUS+JKsd2nsT4/gvhHu5wm4K8Ldf8ClsU+qKzqmqv9HANH2he7T4EexyPncpjHGM5hMYbyjBUwAI5OrOZrI5Xt2VJrrLICkI7DJaZ8MluPR9cj6niLczRGWG8dyiqy3R1huHctXiv6Ly9bsCMzsyeCNub0TlRKLPx/hfoHFX7rVPUHMWtqKiy2C+JmteLB/S8MdYjnIgWjqfEZtVwm14zUI6QCfz/khL5mAWWuM4IfzVhbVJS241ae7xN9+12cv2fHknfeUvHZTPhrRrOyyi/jH706O6Lyn5HVIpG6VxoNxmOpCMWlAo2kl1NSClko79VgjhTLwCgor2EClRAMjmqij7xnPOE1OGo7vBxb1KaHHo6vRGaH2YDoAvfwe8PYiO6sdvAPA9q1srUZR+/c2r0vnSIoPiftWI/vYzw07W3Yy8vMEJpOJ1568qf2cLE4gs66tUlH/VcCrlbNkmkRcJ1DV+EI+4BZhyRRRUy8nUIi6bbgzPbfasGodWg7kJgEt8wLDGZoVoofIvCwZn4eKzRcEuLy4kJ62M9RYDc439g6kT6Whucgo4EV3HtkOGNrCmaCn35D7TedNNW4rC84Df9Vhk8voWQtOf6ZzplZyBnoPiaezZ/QE7D4LFsZIncSxrgr70z7rSKh5TKtItdywBiPUTThTYqVREXEWnA84aMSpJapQIS9R2R/4MOc76AdeS0s1bYLNPypOmAY=
Steps to reproduce
What is expected?
The select box should show option
C
directly from the beginningWhat is actually happening?
v-model
is behaving weirdly when a value is already set while mounting the component.In the following example the select box initially shows option
A
then the Component re-renders and shows the correct optionC
. However the selected ref is set to3
from the beginning according to the output in the console when I'm logging theselected
ref.When using the
v-bind
directive and@change
, everything works fine.Moreover, this error occurs only when using a select box. Other types of input fields (checkbox, radio button, text input) work. Also when doing the same in plain Vue 3 it works.
System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 7.17.0 - /usr/local/bin/npm npmPackages: vue: ^3.2.25 => 3.2.45
Any additional comments?
I also created this Nuxt issue related to this topic: nuxt/nuxt#15631
The text was updated successfully, but these errors were encountered: