-
Notifications
You must be signed in to change notification settings - Fork 46
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
AlternateIdentifier: value disappeares if duplicated scheme error #448
Comments
Is this issue still blocked? Why was it blocked? |
Needed discussion with Zach, due to holidays we couldn't addressed it before. The main point was to remove one prop from formik ( |
Package version (if known): v0.18.0
Describe the bug
While creating a new upload if we fill in the same scheme twice in the "Alternate identifiers" it will throw an error
Alternate identifiers: Only one identifier per scheme is allowed.
but in the field the values will dissapear.Note: It happens only when creating the draft for the first time.
Steps to Reproduce
Expected behavior
Incorrect values should be highlighted with the error message.
Screenshots (if applicable)
Additional context
Also check other ArrayFields such as
Related works
as they may have the same issue.Investigation
The issue is coming from the fact that formik's initial values are tightly coupled with the redux state. This is probably not ideal as a solution,
initialValues
were probably meant to keep the initial state of the form to run the diff on the fields, not to update the state from redux state(which is reflecting the backend's record payload).As discussed internally, the form should only keep the users actions in the current state and the initialValues from the first loading point.
The record state (redux state) should be decoupled from the formik state, in order to preserve the user's operation history (only user input)
We discussed updating the initialValues only on success response, however it does not work if the error happens even before saving the first draft
The text was updated successfully, but these errors were encountered: