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

FormulateInput "checkbox" and "radio" options not working with validation as expected #6

Closed
andrew-boyd opened this issue Mar 1, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@andrew-boyd
Copy link
Member

andrew-boyd commented Mar 1, 2020

I'm putting together some homepage demos on vueformulate.com which is using @braid/vue-formulate at version 2.0.4 and in the process have noticed that the "checkbox" and "radio" input types do not validate as I expect.

checkbox

When creating an input with type of checkbox the value is present without an interaction as an empty array rather than the key not existing in the returned object all.

checkbox-empty-array

My expectation would be to have it dropped from the modeled data entirely. Additionally, even though the demo has a validation rule of required|min:1 it is not failing the check when I submit the form.

checkbox-empty-array-validation

radio

A similar issue exists when the input is set to radio. The Initial value without any user interaction to the form appears to be the last option in the array of choices.

radio-initial-selected-value

This means that it also does not fail the validation rule check because there's a mapped value by default in the v-modeled values object.

checkbox-initial-value-validation

@andrew-boyd andrew-boyd added the bug Something isn't working label Mar 1, 2020
@andrew-boyd
Copy link
Member Author

Deployment exhibiting this behavior can be seen here: https://vueformulatecom-obv6n2h7v.now.sh/

@justin-schroeder justin-schroeder self-assigned this Mar 1, 2020
@justin-schroeder
Copy link
Member

Yep, this is no bueno. Not sure why the tests haven’t caught this behavior, but we can write some against this specific issue and resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants