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

How to skip automatic validation after noValidate was deprecated? #4379

Open
1 task done
ioanac95 opened this issue Nov 13, 2024 · 1 comment
Open
1 task done

How to skip automatic validation after noValidate was deprecated? #4379

ioanac95 opened this issue Nov 13, 2024 · 1 comment
Labels

Comments

@ioanac95
Copy link

Prerequisites

What theme are you using?

core

What is your question?

The noValidate prop on the Form component appears to have been deprecated in a recent release, prompting the omission of the validator to achieve the same goal in the future. However, for now the validator prop is required.

What is the recommended approach for skipping validation, for now?

Some background: I'm using rjsf to render a form whose definition is sent from a backend, and I'm using a mobx store to handle both change events, saving intermediate state (which involves a server request and validation of fields without taking into account required fields in the schema) and submission. Initially, I was relying on the inbuilt validation mechanisms for submission, and setting the extraErrors prop for the server errors or the custom validation happening on save. However, resetting the errors set from submit only happened on resubmission, and because of the use of Mobx with the form the liveValidate was causing problems (validating the whole form on page load when setting an empty formData prop). It seems like there's no recommended approach for resetting these errors without validating the whole form again, is that correct? To avoid these clashes and have more control over setting errors, I'm now using the extraErrors prop for submission as well and so want to skip the default validation mechanisms.

Appreciate the support!

@ioanac95 ioanac95 added needs triage Initial label given, to be assigned correct labels and assigned question labels Nov 13, 2024
@heath-freenome
Copy link
Member

@ioanac95 when we remove the noValidate flag we will make the validator optional.

@heath-freenome heath-freenome removed the needs triage Initial label given, to be assigned correct labels and assigned label Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants