Resolved value is incorrect for groups of multiple checkboxes in PrimeVue Forms #7169
Open
1 of 4 tasks
Labels
Status: Pending Review
Issue or pull request is being reviewed by Core Team
Milestone
Describe the bug
Using PrimeVue Forms, when a group of checkboxes is present, the form state does not include all the values but only the state for the last changed checkbox.
Pull Request Link
No response
Reason for not contributing a PR
Other Reason
I think I located the problem: in packages/forms/src/useform/index.js. The state is overwritten with the last checkbox changed.
I don't know how to fix that: I think the state should be an array when several checkboxes with the same name are present in the form, but I am unsure of how to check for this condition and prevent issues with single checkboxes.
Reproducer
https://stackblitz.com/edit/primevue-forms-checkbox-group-issue?file=src%2FApp.vue
Environment
Vue version
3.5.13
PrimeVue version
4.2.5
Node version
20.18.0
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
I expect the resolved value to be an array containing the values of all the checked checkboxes, or to be empty if none are selected.
The text was updated successfully, but these errors were encountered: