I have a schema with a top-level boolean property (called parent) which is used to conditionally add another property with a default value (called child) via an if-then-else statement. RJSF correctly shows/hides child based on the value of parent, however, the default value of child is always included in form data.
Similarly, in the case where child does not have a default and you:
set parent=true
input a value for child
set parent=false
The child field is hidden in the form but the value is still included in form data.
Expected Behavior
That the value of child is conditionally included/excluded from form data.
Steps To Reproduce
Check out this playground example recapitulating the scenario above. Notice how the value of child is included in form data regardless of the value of parent.
Prerequisites
What theme are you using?
mui
Version
5.x
Current Behavior
I have a schema with a top-level boolean property (called
parent
) which is used to conditionally add another property with a default value (calledchild
) via anif-then-else
statement. RJSF correctly shows/hideschild
based on the value ofparent
, however, the default value ofchild
is always included in form data.Similarly, in the case where
child
does not have a default and you:parent=true
child
parent=false
The
child
field is hidden in the form but the value is still included in form data.Expected Behavior
That the value of
child
is conditionally included/excluded from form data.Steps To Reproduce
Check out this playground example recapitulating the scenario above. Notice how the value of
child
is included in form data regardless of the value ofparent
.Environment
Anything else?
No response