-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$ref object pointing to oneOf list does not update form properly when changed #3833
Comments
@Nezteb thanks for the report and thorough issue search! This might have the same root cause as #3711, where certain properties exist in the JavaScript object representation of the form data, that you can't see in the serialized JSON form data shown in the playground. Unfortunately, maintainers' time is limited to work on every fix, so we rely on community contributions for certain issues. Would you be interested in investigating and providing a PR? |
@nickgros Sure! If you have any advice of specific modules/files/classes to look at or where any relevant unit tests might be, that would go a long way in getting me started. 😄 |
MultiSchemaField might be a good place to start, since the right behavior isn't happening when @heath-freenome may have other ideas for what might be causing this. |
@Nezteb So if I select |
I've now run into this issue as well. I don't believe it actually has anything to do with the It seems when it doesn't know an explicit value to set the form data to, it fails to switch the Like I mentioned, you can remove the definition and |
@tyrdavis Is this something you feel comfortable fixing for us? |
Prerequisites
What theme are you using?
core
Version
5.x
Current Behavior
$ref
objects pointing to objects withoneOf
lists do not update properly when a user tries to change the value via dropdown.Expected Behavior
The dropdowns should be updating properly when the user changes the value.
Steps To Reproduce
Playground link: https://rjsf-team.github.io/react-jsonschema-form/#eyJmb3JtRGF0YSI6e30sInNjaGVtYSI6eyJ0aXRsZSI6Im9uZU9mIEV4YW1wbGUiLCJ0eXBlIjoib2JqZWN0IiwicHJvcGVydGllcyI6eyJzdGF0dXMiOnsiJHJlZiI6IiMvZGVmaW5pdGlvbnMvc3RhdHVzIn19LCJkZWZpbml0aW9ucyI6eyJzdGF0dXMiOnsidGl0bGUiOiJGaWVsZCBTdGF0dXMiLCJ0eXBlIjoib2JqZWN0Iiwib25lT2YiOlt7InRpdGxlIjoiQXBwcm92ZWQiLCJ0eXBlIjoib2JqZWN0In0seyJ0aXRsZSI6IlJlamVjdGVkIiwidHlwZSI6Im9iamVjdCIsInByb3BlcnRpZXMiOnsicmVhc29uIjp7InRpdGxlIjoiUmVqZWN0aW9uIFJlYXNvbiIsInR5cGUiOiJzdHJpbmcifX19XX19fSwidWlTY2hlbWEiOnt9LCJ0aGVtZSI6ImRlZmF1bHQiLCJsaXZlU2V0dGluZ3MiOnsic2hvd0Vycm9yTGlzdCI6InRvcCIsImV4cGVyaW1lbnRhbF9kZWZhdWx0Rm9ybVN0YXRlQmVoYXZpb3IiOnsiYXJyYXlNaW5JdGVtcyI6eyJwb3B1bGF0ZSI6InBvcHVsYXRlIiwibWVyZ2VFeHRyYURlZmF1bHRzIjpmYWxzZX0sImVtcHR5T2JqZWN0RmllbGRzIjoicG9wdWxhdGVBbGxEZWZhdWx0cyJ9LCJsaXZlVmFsaWRhdGUiOmZhbHNlfX0=
Schema:
Environment
Anything else?
The closest existing issues I could find to this are below, but none of them seem caused by the same problem as far as I can tell. In each of those cases, the dropdown text does update, whereas mine does not.
The text was updated successfully, but these errors were encountered: