react-jsonschema-form
react-jsonschema-form copied to clipboard
Fix: made small changes to utility functions to fix #3997, #4314 and #4322
Reasons for making this change
Fixes #3977, #4314, #4322
- In
@rjsf/utils, made the following changes:- Added
mergeDefaultsIntoFormDataoption toExperimental_DefaultFormStateBehaviortype to control how to handle merging of defaults - Updated
mergeDefaultsWithFormData()to add new optionaldefaultSupercedesUndefinedthat when true uses the defaults rather thanundefinedformData - Updated
getDefaultFormState()to pass true tomergeDefaultsWithFormDatafordefaultSupercedesUndefinedwhenmergeDefaultsIntoFormDatahas the valueuseDefaultIfFormDataUndefined - Updated
getClosestMatchingOption()to improve the scoring function so that an object container that matches a key gets an extra point
- Added
- In
@rjsf/core, updatedMultiSchemaFieldto callonChangeafter setting the new option in state rather than before - In the playground, added controls for the new
mergeDefaultsIntoFormDataoption- Moved the
Show Error Listcomponent over one column, making it inline radio buttons rather than a select
- Moved the
- Updated the
CHANGELOG.mdaccordingly
Checklist
- [ ] I'm updating documentation
- [ ] I've checked the rendering of the Markdown text I've added
- [ ] I'm adding or updating code
- [ ] I'm adding a new feature
- [ ] I've updated the playground with an example use of the feature
please merge this pr fast
please merge this pr fast
I am having to deal with a regression that was detected in testing and my job is quite busy. Working as fast as I can, sorry
Ok, in order to avoid regressions, I added a new, optional mergeDefaultsIntoFormData prop to Experimental_DefaultFormStateBehavior which can be used to fix the issue seen in #4322