Skip to content

Commit

Permalink
rjsf-team#4079 Fixed the issue where the error state was not resettin…
Browse files Browse the repository at this point in the history
…g when the schema changed.
  • Loading branch information
Abdallah Al-Soqatri committed Feb 23, 2024
1 parent 158fc22 commit 1beaf0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ export default class Form<
const _retrievedSchema = retrievedSchema ?? schemaUtils.retrieveSchema(schema, formData);

const getCurrentErrors = (): ValidationData<T> => {
if (props.noValidate) {
// f the `props.novalidate` option is set, we reset the error state.
// Or if the `retrievedSchema` param is undefined, this indicates that the schema has changed. Therefore, we also reset the error state.
if (props.noValidate || typeof retrievedSchema === 'undefined') {
return { errors: [], errorSchema: {} };
} else if (!props.liveValidate) {
return {
Expand Down

0 comments on commit 1beaf0f

Please sign in to comment.