-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Bug: Issue with formData not updating when dependencies change #4388
base: main
Are you sure you want to change the base?
Conversation
@abdalla-rko Can you fix the tests? |
…e it thinks there isn't exactly one subschema that is valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions and one suggested fix and I believe we are good to go
CHANGELOG.md
Outdated
@@ -16,6 +16,12 @@ should change the heading of the (upcoming) version to include a major version b | |||
|
|||
--> | |||
|
|||
# 5.24.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be 5.23.3
since there isn't a new feature?
} | ||
return formData; | ||
return overrideFormDataWithDefaults ? defaults : formData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to optimize this logic so that we have:
if (/*conditions for defaults*/) {
return defaults;
}
return formData;
* Ensure that the formData matches the given schema. If it's not matching in the case of a selectField, we change it to match the schema. | ||
* @param validator - an implementation of the `ValidatorType` interface that will be used when necessary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Ensure that the formData matches the given schema. If it's not matching in the case of a selectField, we change it to match the schema. | |
* @param validator - an implementation of the `ValidatorType` interface that will be used when necessary | |
* Ensure that the formData matches the given schema. If it's not matching in the case of a selectField, we change it to match the schema. | |
* | |
* @param validator - an implementation of the `ValidatorType` interface that will be used when necessary |
Reasons for making this change
Fixes #4325
Checklist
npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update
to update snapshots, if needed.