Skip to content
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

[V4] Inconsistent behaviour with checkbox meta.valid property #3927

Closed
5 tasks done
Antimated opened this issue Sep 15, 2022 · 1 comment · Fixed by #3930
Closed
5 tasks done

[V4] Inconsistent behaviour with checkbox meta.valid property #3927

Antimated opened this issue Sep 15, 2022 · 1 comment · Fixed by #3930
Labels
🐛 bug Unintended behavior 🛳 In PR This issue is being addressed in a PR

Comments

@Antimated
Copy link

Antimated commented Sep 15, 2022

What happened?

Hi,

I have this form with a consent checkbox at the bottom of the form. I used this example pulled from the docs to create the checkmark. The problem is that meta.valid (and probably other meta properties) are working very inconsistent... I also provided a demo link below, as well as some reproduction steps (me and my coworker both tested these reproduction steps so I hope they also work for you.)

Reproduction steps

  1. Check the checkbox
  2. Uncheck the checkbox
  3. Click somewhere in the page (e.g. the meta object)
  4. Click a few times on the checkbox and see that the meta.valid prop is not updated correctly (unless you click next to it)
    ...

Version

Vue.js 3.x and vee-validate 4.x

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Relevant log output

No response

Demo link

https://stackblitz.com/edit/vee-validate-v4-checkboxes-snurs1?file=src%2FApp.vue

Code of Conduct

@Antimated Antimated changed the title Inconsistent behaviour with single checkbox meta validation Inconsistent behaviour with checkbox meta validation Sep 15, 2022
@Antimated Antimated changed the title Inconsistent behaviour with checkbox meta validation [V4] Inconsistent behaviour with checkbox meta validation Sep 15, 2022
@Antimated Antimated changed the title [V4] Inconsistent behaviour with checkbox meta validation [V4] Inconsistent behaviour with checkbox meta.valid property Sep 15, 2022
@logaretm logaretm added the 🐛 bug Unintended behavior label Sep 17, 2022
@logaretm
Copy link
Owner

Thanks for reporting this. The bug was caused by the input event triggering before the change event. Since both signal a value change, vee-validate tries to avoid toggling the value twice by skipping it for the change event.

This means the validation could also be incorrectly skipped. I am working on a fix at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unintended behavior 🛳 In PR This issue is being addressed in a PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants