New feature
- requiredBooleanDefault was added to the
Experimental_DefaultFormStateBehavior
@rjsf/core
- Fixed a
schemaprop change being silently dropped when it adds a property with adefault, either as the parent's reply toonChangeor at any point after a change to an uncontrolled form. The guard that keeps a oneOf/anyOf option switch from reverting now only applies when the form re-derives its ownformData(an uncontrolled form, or a parent holding whatonChangeemitted, including when it reshaped the emitted value by spreading it, storingundefinedasnullor round-tripping it through JSON) with the sameschemaandexperimental_defaultFormStateBehavior, and it keeps only thatformDatarather than dropping the rest of the prop update, fixing #5294 - Fixed switching between
oneOf/anyOfoptions keeping a value the previous option'sdefaultput there, so a property whose value still matches that default, or a whole option that does, now picks up the new option'sdefaultthe way a scalar property already did, and switching back to an option restores its own defaults. A property the new option cannot hold as it stands now picks the newdefaultup as well instead of arriving empty — one whose type differs between the options, or areadOnlyone edited away from its default. Values are compared whole, so a nested object the user has partly edited keeps the rest of the old option's defaults, and a value equal to the old default is replaced no matter who supplied it, including one passed informData, since the two cannot be told apart, fixing #4476
@rjsf/utils
- Updated
Experimental_DefaultFormStateBehaviorto add a newrequiredBooleanDefaultoption, and updatedgetDefaultFormState()to honor it:skipturns off thefalsepopulated for a required boolean with nodefault(introduced in 6.9.0 by #5170), so a form that models an unanswered boolean as its own state can keep itundefinedand letrequiredreport it. The default,populateFalse, keeps the 6.9.0+ behavior
@rjsf/validator-ata
- Updated
ata-validatorfrom^1.7.1to^1.23.0, picking up the corrected error shape forunevaluatedProperties(the error now carriesparams.unevaluatedProperty), the removal of a quadratic inadditionalProperties: falseschemas with many properties, a fix for a hang on truncated JSON input, and enforced strict-mode schema checks (#5293)
Dev / docs / playground
- Documented the
requiredBooleanDefaultoption inform-props.mdandinternals.md, and added a selector for it to the playground