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
When I create a property dependency and the dependent property is an array with multiple options whose options change based on the dependency, if I start to select options, then switch the dependent field, the formdata does not clear the invalid options.
Expected Behavior
Invalid array options are cleared when the available list of options changes
@joesolly It definitely seems related. Are you interesting in figuring out how to fix it by adding a new feature?
@heath-freenome I'd be willing to take a stab at it if you have an idea of where to point me. I'm currently working around this by hardcoding clearing the formdata when the particular field changes.
@joesolly The culprit is likely the sanitizeDataForNewSchema() function in the @rjsf/utils package. It currently does not have logic for dealing with anyOf/oneOf in either an object or and array>items situation. It's also possible that it needs to deal with dependencies as well (although it does use retrieveSchema which theoretically handles dependencies for us). We'd love help expanding it's capabilities.
Prerequisites
What theme are you using?
core
Version
5.24.1
Current Behavior
When I create a property dependency and the dependent property is an array with multiple options whose options change based on the dependency, if I start to select options, then switch the dependent field, the formdata does not clear the invalid options.
Expected Behavior
Invalid array options are cleared when the available list of options changes
Steps To Reproduce
Playground Sandbox Link
See the video of me demonstrating it with the Playground Sandbox
Screen.Recording.2025-01-23.at.9.47.20.AM.mov
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: