Vee-validate: Checkboxes in Form/Field combination get unchecked when clicking anywhere on the page

Created on 6 Oct 2020  路  2Comments  路  Source: logaretm/vee-validate

Versions

  • vee-validate: 4-beta2
  • vue: 3

Describe the bug
Checkbox validation fails. Once you click outside of a checkbox, the checkbox gets unchecked.

To reproduce
Steps to reproduce the behavior:

  1. Go to https://vee-validate.logaretm.com/v4/examples/checkboxes-and-radio
  2. Scroll to checkbox example
  3. Click on any check box, click on another checkbox or elsewhere
  4. See checkbox getting unchecked.

Expected behavior
Check box stay checked, submit button will work as expected showing an alert of checked checkboxes.

Demo link
Checkbox example on https://vee-validate.logaretm.com/v4/examples/checkboxes-and-radio

Desktop (please complete the following information):

  • OS: Linux
  • Browser Firefox
  • Version 81

Additional context
we face an identical issue with latest beta2 of v4 and not being able to create a "accept terms" validation checkbox in our code.

thx, marius.

馃悰 bug

Most helpful comment

Thank you for reporting this, it was caused by having listeners on both onBlur and onChange which each toggled the input value.

All 2 comments

Thank you for reporting this, it was caused by having listeners on both onBlur and onChange which each toggled the input value.

thanks for fixing this... I can cofirm that it works again in [email protected] ..

Was this page helpful?
0 / 5 - 0 ratings