Previously, formio.js would clear radio components with the option inputType: checkbox when a new row was added to the datagrid. This PR replaces this behavior by retaining the state of the checkbox when data grid adds a new row
Why have you chosen this solution?
Although there were many potential solutions, my solution was best because it adds a check to see if the element property on the component has the property checked to true to verify that the component is checked. It also does not remove value[input.value] to allow for reverse compatibility.
Dependencies
N/A
How has this PR been tested?
I added automated tests to cover checkbox when checked and checkbox when unchecked cases. I also verified that removing my change from this PR will break these tests to validate that my tests are working as intended.
Checklist:
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation (if applicable)
[x] My changes generate no new warnings
[x] My changes include tests that prove my fix is effective (or that my feature works as intended)
[x] New and existing unit/integration tests pass locally with my changes
[x] Any dependent changes have corresponding PRs that are listed above
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-8438
Description
What changed?
Previously, formio.js would clear radio components with the option inputType: checkbox when a new row was added to the datagrid. This PR replaces this behavior by retaining the state of the checkbox when data grid adds a new row
Why have you chosen this solution?
Although there were many potential solutions, my solution was best because it adds a check to see if the element property on the component has the property checked to true to verify that the component is checked. It also does not remove value[input.value] to allow for reverse compatibility.
Dependencies
N/A
How has this PR been tested?
I added automated tests to cover checkbox when checked and checkbox when unchecked cases. I also verified that removing my change from this PR will break these tests to validate that my tests are working as intended.
Checklist: