When form renders, the errors array is empty until onChanges is called(user types into input field)

Hi all,

As the title states my form is being rendered with multiple required fields. I have used the (errors) prop to store all errors in a local array instance. Once the form is rendered the errors array is empty, but once I type into an input field the errors appear in the error array. Is this normal behavior? Is there a way around this? I’ve messed around with change detection, but had no luck. My use case is not allowing the user to submit the form if there are any errors.

Thanks for your time,
Justin

Hi @Jayrack813,

which version of JSON Forms and which bindings / renderer set are you using? JSON Forms should output the initial errors while performing the first renderer pass.

Hi Stefan,

I’m using 3.0.0-alpha.1, and I have created my own renderer set using bootstrap. Basically copied Angular Material and then added the bootstrap to the template. Any Idea what could be causing this behavior?

Looking at the code it seems like we actually do not output the initial data and errors in the Angular bindings. We should output them right after this init call.

Can you open an issue in the JSON Forms repo? Would you be willing to contribute a fix?

Ok, I will open an issue on the repo. I’d be willing to try to. It should be rather straight forward of outputting the errors in the init call, right?

Yes, the fix is probably less than 5 lines.