-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Checkbox does not mirror the state #12070
Comments
For accessibility technology, a checkbox is needed. But I need to control the state of the checkbox from JS logic, without switching it automatically when clicked. It would seem that changing the state in the click handler should cause rendering, but it does not happen. |
|
Using pure js has the same effect, see MDN playground |
F.Y.I. vuejs/rfcs#188 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Vue version
3.5.10
Link to minimal reproduction
https://play.vuejs.org/#eNqtU8Fu2zAM/RVOl7ZAYC/odsmcYFvQw3rYhjVHAYNj04laWRIk2ctg+N9HyXaSdmtOu4l8j+R7lNSxT8YkbYNswTJXWGE8OPSNWXElaqOthw4sVtBDZXUNV0S94oqrQivnodhj8QTLwLiucunw5sMzaCNq1I1/yeCqalThhVZQSFE8Xd9AxxUMNUmbywap5M1ZSEX933Vj+6mchE8ZSi1XQ3ZsOyIvuj/L0hCAfgbzoJHGZemwEdoFBR5rI3OPFAFk+/nq/gHIqrdaSiyHIVt9yFKCIsWsNns85sF5KoZSowOlw35ytcNFloZVE7sUbTzQUeZblGNAoVCGVuh/G1xyNrXjDBbxjOWUpdTHuJbEWGxR+QCEmID02G4dqAvouljTk804JD0NzdJBy2hira3FwsMW93krtP2fksf1v6r8hL9mYGRc8pGlZ1fHZsw7urZK7JJHpxW9+/hKaKCujZBov5nwwBxnNGNoylkupf51H3PeNjib8lHCP/KPjtwu6PDdokPbImdHzOd2h2QpwHcPX/FA5yNY67KRxL4A/kCnZRM0DrTPjSpJ9hkvqv0Sf69Qu427O3hUbjIVhA4PffBNP3p9wfpJ7m3yLtbR36At/mzRhp60wNvkfTJ/y/o/rTVuJA==
Steps to reproduce
@click.prevent=
check.value = !check.value;
What is expected?
The checkbox reflects the
state
What is actually happening?
The internal state of the checkbox is kept as is.
System Info
Any additional comments?
Adding timeout fixes the issue:
The text was updated successfully, but these errors were encountered: