Skip to content
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

"Invalid Keypath" error when editing FieldArray after submit has failed. #2875

Closed
dagstuan opened this issue May 3, 2017 · 2 comments
Closed

Comments

@dagstuan
Copy link
Contributor

dagstuan commented May 3, 2017

Are you submitting a bug report or a feature request?

Bug report

What is the current behavior?

https://codesandbox.io/s/MPzRZV21

If you submit the form, and then (after the submit has failed) try to add/delete members and edit their fields. An "Invalid KeyPath" error will be logged to the console. This is only while using the immutable.js-version of redux-form.

What is the expected behavior?

No "invalid keypath"-message

Other information

I have narrowed this problem down to the code for ArraySplice which inserts undefined into the state for submitErrors and asyncErrors. When editing one of the fields inside a FieldArray the code deleteInWithCleanUp(result, submitErrors.${field}) is called, which tries to update the submit errors for the field inside the array, however, the array element is set to "undefined" in the state, and a call to immutable.js such as state.updateIn(['form', 'formName', 'submitErrors', '0', 'fieldName'], /* rest */) fails with the "Invalid KeyPath" error.

@erikras
Copy link
Member

erikras commented May 9, 2017

Published fix as v6.7.0.

@erikras erikras closed this as completed May 9, 2017
@lock
Copy link

lock bot commented Jun 1, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants