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 clicking "opt" to make it false, "a" and "b" should be omitted from the form data. I should end up with the form data's value of "arr" to equal ["c", "d"].
Actual behavior
"a" and "b" is not omitted from the form data. I end up with the form data's value of "arr" to equal ["a", "b", "c", "d"].
Version
1.6.1
The text was updated successfully, but these errors were encountered:
@epicfaace I need to ask a question about a snippet of code that seems to be causing this,
while trying to work on this (not updating the FORM DATA properly when updating the values in the form) we noticed that the issue occurs only when we have both omit extra data and live omit both checked, this has only one consequence in the entire codebase (only one condition is dependant on both these flags at the same time) which is in react-jsonschema-form>packages>code>src>component>form.js :
commenting this condition seems to solve the problem (at least superficially), now to my question, what is the purpose of this condition?
in the code you mentioned the following:
If omitExtraData and liveOmit are both set to true, then extra form data values that are not in any form field will be removed whenever onChange is called. Set to false by default.
commenting out this condition seemed to resolve both the issue mentioned above and adding arrays to the formData.
Prerequisites
Description
Playground link
Steps to Reproduce
Expected behavior
When clicking "opt" to make it false, "a" and "b" should be omitted from the form data. I should end up with the form data's value of "arr" to equal ["c", "d"].
Actual behavior
"a" and "b" is not omitted from the form data. I end up with the form data's value of "arr" to equal ["a", "b", "c", "d"].
Version
1.6.1
The text was updated successfully, but these errors were encountered: