[BUG] The data grid component doesn't save submission data of the first row
Environment
Please provide as many details as you can:
- Hosting type
- [ ] Form.io
- [ x ] Local deployment
- Version:
- Formio.js version: 4.3.0
- Frontend framework: ReactJS
- Browser: Chrome
- Browser version: Version 89.0.4389.114 (Official Build) (x86_64)
Steps to Reproduce #
-
On the form builder, create a data grid component, add components to the row.
-
Go to form view, fill in data for the first row and add more rows.

-
Check the data json in react dev tool, the first item is an empty array which should not be.

Expected behavior
Save all data
Observed behavior
At the moment, this problem only can be fixed by editing the component on the form builder manually (not by code). Here is the steps to reproduce:
- Edit a form
- Add a data grid component
- Edit it
- Switch to "Data" tab
- Click on "Add another" to add one
- Remove the first one. Save it
- Fill in data on the form view. Check the react dev toll, data appeared.
I have this bug to... here is a video of the issue: https://youtu.be/tkCQCksowk4
@namti @HCMF
What versions of formio.js are you running on?
I am also using 4.3.0
This formio.js is rather old. Can you try upgrading? The latest stable version is 4.13.1.
As this is the React version, is it possible to update just the core formio.js?
I have spotted the bug.
The first row which is generated by default always returns an array with object keys and values in it.
When setState in react, the illegal array is ignored and it is fell back to an empty array.
I have tried to upgrade to 5.0.0-rc.2, unfortunately the bug is still there.
@namti, We welcome a pull request if you can provide a fix for the issue, then we can pull it in.
@namti great that you found the issue! Did you commit the fix? If you do I will buy you dinner! 😋
I am also having trouble with this bug. Was it ever resolved?
We are not able to reproduce this in the latest versions. Are you still having this issue in the latest versions?
Thank you for your contribution. As this issue has been inactive for over 90 days, I will close it for now. If you wish to reopen the issue, please respond, and we can resume the triage process.