Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support setting (partial) form values and errors #78

Open
3 tasks
sergei-maertens opened this issue Mar 11, 2025 · 0 comments · May be fixed by #84
Open
3 tasks

Support setting (partial) form values and errors #78

sergei-maertens opened this issue Mar 11, 2025 · 0 comments · May be fixed by #84
Assignees

Comments

@sergei-maertens
Copy link
Member

Initially, the SDK will still call the backend for logic evaluation. Pushing the logic to the frontend will come at a later stage, but it will likely not be possible to completely eliminate backend logic (for things like service fetch/secrets that should not leave the server).

Logic checks run async and are (possibly) debounced, meaning there is noticeable delay from user input until the result/outcome of the logic check is known. One of the effects of such a logic check is that form values may be updated programmatically. The logic check only returns a diff of inputs that have changed to avoid race conditions with new user input provided between firing the check and receiving the response.

The formio-renderer must be able to handle partial updates on the form values to process the result of a logic check. The component rendering FormioForm is responsible for (imperatively) calling this.

Similarly, validation errors coming from step/form submission backend validation must be possible to be set by the parent component, as the frontend validation is not necessarily capable of figuring all this out (e.g. like the anti-prefill tampering protection).

The Formik implementation details should not leak so that if we need, we can swap the underlying Form library.

Tasks

  • Expose ref from FormioForm
  • Allow calling updateValues with partial updates, which must deep merge the Formik values
  • Allow calling updateErrors with partial updates, which must deep merge the Formik errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant