-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
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 (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
gasnew