You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Environment
- OS: Ubuntu
- Node: 18
Anything else?
No response
The text was updated successfully, but these errors were encountered:
donalddalton
changed the title
Unexpected behavior when conditionally including fields with defaults inside of if-then-else
Unexpected behavior when conditionally including fields if-then-else
Nov 1, 2024
donalddalton
changed the title
Unexpected behavior when conditionally including fields if-then-else
Unexpected behavior when conditionally including fields with if-then-else
Nov 1, 2024
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
The text was updated successfully, but these errors were encountered: