-
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
Object defaults for "additionalProperties" result in rows that cannot be deleted and have side effects when modified #3759
Comments
@dd12440 Wow! great bug find. Given how little time us few maintainers get to spend on the project (we volunteer a few hours a week generally), we could really use some help fixing this. Is this something you can help us with? |
@heath-freenome, I'm going to plan to try to find time to prioritize this. With that said, if anyone else is experiencing this issue and is motivated to address it, then there will be no complaints from me. |
@dd12440 that would be awesome |
react-jsonschema-form/packages/utils/src/schema/getDefaultFormState.ts Lines 472 to 474 in ef5afed
When the above code called immediately after changing the form, the |
Any update on this? I just ran into the same issue. Looks like onChange is regenerating the defaults and merging them every time something changes (edit/remove). Is that expected behavior? |
My only update here is that I have not and (unfortunately) do not expect to be able to work on this in the foreseeable future. If someone else has time, this would certainly be a major improvement to the library. |
Prerequisites
What theme are you using?
mui
Version
5.9.0
Current Behavior
For an object type, default values are seemingly assumed to map to "properties" rather than "additionalProperties," or at the very least, mapping them to "additionalProperties" does not seem to work as expected. Take the following
JSONSchema
example:As the linked playground shows, when the form renders, it does render with an entry matching the "test-key" entry in the default. However, the following issues are present:
Expected Behavior
Any object key specified within the default object should be understood to be an "additional" property if it does not match some property specified in "properties". Thus, the following conditions would hold:
Steps To Reproduce
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: