vue-formulate
vue-formulate copied to clipboard
Initial values for checkboxes in schema are not set on form submission
Describe the bug Creating a form using a json schema with checkboxes with initial value does not set initial value on form submission.
Reproduction https://codepen.io/hisuwh/pen/powJJex
Expected behavior All initial values should be in form submission.
Note: it seems to work as expected for text inputs
Screenshots
Device information:
- Device: Windows 10 PC
- OS: Windows 10
- Browser Google Chrome
- Version 92.0.4515.159
Think I've got a fix. Will send a PR
Seems there is also a workaround by setting value as well as checked:
const schema = [
{
type: "checkbox",
name: "myInput",
label: "My Checkbox",
checked: true,
value: true
}
...
]