Replies: 1 comment
-
Yeah, this seems like a quirk (or bug) in how handles the initialForm prop. When you pass a full schema, it may not trigger the internal state setup that hooks into onChange. A quick workaround is to manually trigger onFormChange once after setting initialForm, or try reinitializing the component after schema load using a key prop. Could also be worth checking if the builder expects initialForm to come through a form prop instead — depends on the version or wrapper. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have made some simply setups pages with formio form builder which uses the custom builder and then made an additional page view where you can edit the form.
When creating the form using the form builder as such
<FormBuilder options={options} onChange={onFormChange}/>
it works fine and catches the change
But when trying to use it as edit as such where it simply loads in the schema created by the form builder like such
<FormBuilder initialForm={schema} options={options} onChange={onFormChange}/>
It doesn't catch any of the changes made in the form. It loads the form fine and I can edit it. But it will not trigger the onChange. If I remove the initialForm it works fine.
I tried with just the hardcoded schema and using the schema passed as the JSON created by the builder.
It seems to fine if the initialForm is passed as empty object or string but not a full schema.
Anyone got an idea what is going or is it simply a bug on the formBuilder?
Beta Was this translation helpful? Give feedback.
All reactions