-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
Input checkbox value won't change when trigger is coming from click #13083
Comments
Hi! This is expected behaviour because To fix this in your code, either remove |
Just to expand on this a little...
I don't think this is entirely accurate. Under normal circumstances Vue would update a bound Clicking the button in that example does update the rendered The problem in the reproduction seems to be very specific: you can't update the This seems quite unintuitive to me, preventing the default action somehow cancels manually overriding the I found a related discussion on Stack Overflow: Based on that discussion, what seems to be happening is:
I've put together another example to try to illustrate this: In particular, notice the logged value of |
Vue version
3.5.13
Link to minimal reproduction
https://play.vuejs.org/#eNp9Uk1v2zAM/SuELnGAwEaR7ZLa2UfXQ3fYim1HAYNi045bWRIk2ctg+L+Xkus0BYqeJD4+ko9PGtkXY9KhR7ZjuSttazw49L3Zc9V2RlsPI1isN1DqzvQeK5igtrqDFRWtuCq1ch4EFIGVcCY4W18vcN1a538a32pFhKVDkqyh2INIByF7hKIoYCVWL1XCe+xIRwEJRubIFQCmxuKAyn/DWvTSJ+trwpzX5t5qIxoRphAYuOfWr4ZEcfCJzgOduzkm/sRVns2709YUhPFSeKQIID9e7W+OWD4e9AldnlEYYVKzH0cxTXkWrhGT4oAyXiloFW0LuzLUYlVwduEGzf9cyrZ8JPh5XYL8f4MExAqaxtlzqztwR93LCg4I5VGohl6BHI0N4txsGZxnF9rZhnlHltZtkz44reiJo5M0gV6ilWhnMY6z3exxyAkp9b/vEfO2x82CR1Vv4A+OhAYz7y06tANyds55YRukzUL69vcPPNH9nOx01Utiv5P8hU7LfjYs0L72qiLZF7yo9i5+1FY1f9ztyaNyy1JBaGBOkc8Zfdmbd1Z/kbtNP8Q6+hzk4t8BbehJBm7Tj+nVlk1PF4wOOQ==
Steps to reproduce
What is expected?
The checkbox should toggle between checked and unchecked states when clicked.
What is actually happening?
The value of a changes (as shown in the
The text was updated successfully, but these errors were encountered: