Skip to content

FieldArray doesn't work nicely with radio inputs #5013

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

Open
2 of 5 tasks
Ellarddekoeijer opened this issue Mar 25, 2025 · 0 comments
Open
2 of 5 tasks

FieldArray doesn't work nicely with radio inputs #5013

Ellarddekoeijer opened this issue Mar 25, 2025 · 0 comments

Comments

@Ellarddekoeijer
Copy link

Ellarddekoeijer commented Mar 25, 2025

What happened?

When using FieldArray I get unexpected behavior while using radio buttons. When deleting indexes the browser seems to lose the checked state on radio buttons sometimes. I have added reproduction steps and a code example below.

I have found that the issue lies in the usage of indexes as names, this seems to confuse the browser. Much more than that I do not know

Reproduction steps

  1. Add a total of three items.
  2. On index 0, check the first radio.
  3. On index 1, check the second radio.
  4. On index 2, check the first radio.
  5. Remove index 0.
  6. Notice that the old index 1 item becomes index 0, but its radio checked state is gone, while the HTML input element still has the attribute checked.

Version

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

What browsers are you seeing the problem on?

  • Firefox
  • Chrome
  • Safari
  • Microsoft Edge

Demo link

https://codesandbox.io/p/devbox/7zqprr

Code of Conduct

@Ellarddekoeijer Ellarddekoeijer changed the title <title>FieldArray doesn't work nicely with radio inputs FieldArray doesn't work nicely with radio inputs Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant