-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
[Bug Report][3.5.2] VCheckboxBtn - double click is required when @update:model-value does not update model-value #19137
[Bug Report][3.5.2] VCheckboxBtn - double click is required when @update:model-value does not update model-value #19137
Comments
A better way to do this would be using the readonly prop: https://play.vuetifyjs.com/#eNqNUcFOwzAM/RUrHAYSbbXBLqVDQly5IU6UQ5qmrFqaRIlbgab9O266qmUCbbfYfn7P7+V9z7wTyZO1cddKlrIMZWMVR/mYa4Csi7i14RkKYTTyWkt3bA3NrRS7wnxFBeqxDaB4IdUmZ8/HKVwt05xN8y5qTBkQ4/4rkuwckjrJS6PVN4H81rSqfDFiNxK+2ZLwflpI6KizZ02yFzD+5WI1c9ErBrXkNJq+MySXJbNEqfTC1RbBS2wt0etPYkfSDGt1Y41D2IOTFRygcqaBBX3MYnBGGh7hV16w6bHXFVde3jxMoH/dnS5kyXAR6bPDLbuL7+PlmvWPdbxiHz8iB660 With that being said, it still has the same issue. It's more than likely because a state is being set when you click on checkbox 1. |
Environment
Vuetify Version: 3.5.2
Vue Version: 3.4.15
Browsers: Chrome 120.0.0.0
OS: Windows
Steps to reproduce
Some notes to the playground:
Checkbox #1
is where the problem will occur.Checkbox #2
is used to control the behaviour of theCheckbox #1
Steps:
Checkbox #2
Checkbox #1
@update:model-update
event handler is doing nothingCheckbox #2
Checkbox #1
Expected Behavior
After step 4, the
Checkbox #1
should be checkedActual Behavior
After step 4, the
Checkbox #1
is unchecked.Additional click is required on the checkbox to correctly update the value.
Reproduction Link
https://play.vuetifyjs.com/#...
Other comments
Observations:
Probably some internal state in VCheckboxBtn is updated. But if the
update:model-value
handler does not update themodel-value
, then there is mismatch with internal state and modelValue.Workarounds
I have found the following workaround - using
@click.prevent
instead of the@update:mode-value
(as can be seen below), so it's not a big problem, but the issue still remains, that it can happen that internal state of checkbox component is not aligned with the modelValueThe text was updated successfully, but these errors were encountered: