-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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?
core
Version
5.21.2
Current Behavior
we have a schema utilizing oneOf under dependencies to conditionally display fields based on the value selected in a primary field. However, when a user changes the value of the primary field, the values in the subsequent fields do not reset to their default state.
Expected Behavior
Upon changing the value of "Do you have any pets?", all dependent fields should reset to their default values, removing any previously entered data.
Steps To Reproduce
https://codesandbox.io/p/sandbox/jgpnnz
Select "Yes: One" from the "Do you have any pets?" dropdown and enter a value for "How old is your pet?".
Change the selection back to "No".
Then, switch to "Yes: More than one". the value i previously entered is still there.
when I consoled the formdata, what I found is the entered value always persisting..this causing lot of issues when there is chained dependencies.
Environment
- OS:
- Node:
- npm:
Anything else?
need a immediate fix for this