Open cewald opened 3 weeks ago
Afaik in the change above const isValid = validator.isValid(conditionSchema, formData, rootSchema);
returns now false and the before term validator.validateFormData(formData, conditionSchema)
returns true – I try to find why its considered different. FYI I'm using ajv8
as validator.
Afaik in the change above
const isValid = validator.isValid(conditionSchema, formData, rootSchema);
returns now false and the before termvalidator.validateFormData(formData, conditionSchema)
returns true – I try to find why its considered different. FYI I'm usingajv8
as validator.
The change you are pointing out was done to help improve performance since isValid()
is simpler and uses caching better than validateFormData()
. If you patch it locally back to the old implementation, does it work again? If so, maybe we can write a test to catch that issue in isValid()
and fix it?
I see – yes, if I patch it back, it is working.
Hmmm, @nickgros Any thoughts on whether we roll back this change?
Rolling it back seems appropriate with a test to verify that this is fixed. If someone needs the performance optimizations provided by isValid
, it would be on them to to ensure this case still works.
Prerequisites
What theme are you using?
mui
Version
5.5.1
Current Behavior
If I have a first field with an enum and a second dependant field that holds an empty enum at first but should get filled when the first field gets selected, the second dependant field isn't getting filled as long as the enum of the first field is initially empty. If put an initial value in the second dependant fields enum it works fine.
This error came with the version update 5.1.1.
Expected Behavior
Update the dependant field even tough it is an empty enum first.
Steps To Reproduce
You can reproduce it in the playground with the following two schemas.
This is the working one (with an initial string in the dependant enum) (Playground link)
And with this the one its broken since the update (empty initial enum) and wont update the second dependant field: (Playground link)
Environment
Anything else?
I guess I'v nailed it down to this two commit:
https://github.com/rjsf-team/react-jsonschema-form/commit/f34a7a2997e2f520a3677b67629d8f386463f354https://github.com/rjsf-team/react-jsonschema-form/commit/ff46301dbbeb951758c5ee1b2ec0f95a459b4dfe <- its this oneAnd this change in the changelog: https://github.com/rjsf-team/react-jsonschema-form/blob/main/CHANGELOG.md#551
In v5.5.0 my example is working in v5.5.1 not.