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

V6 - Field does not rerender when its sync error changes #1024

Closed
q42jaap opened this issue May 23, 2016 · 9 comments
Closed

V6 - Field does not rerender when its sync error changes #1024

q42jaap opened this issue May 23, 2016 · 9 comments
Labels
Milestone

Comments

@q42jaap
Copy link

q42jaap commented May 23, 2016

I have an array editor, and a validation function.

When I make changes in 1 field, my validation function runs and based on the value of field 1, the validation for field 2 might change (it's not passwords comparison).
When I make changes to field 1, validation is updated only for that field, but when the validation function removes an error for field 2, that error is not removed in the UI.

@ooflorent
Copy link
Contributor

On v6, updating a field does not rerender other fields (unlike v6). This might be what's causing your issue. Could you add some code to diagnose what's happening here?

@imjared
Copy link

imjared commented May 23, 2016

On v6, updating a field does not rerender other fields (unlike v6)

@ooflorent this is the first I'm seeing of this (i'm guessing you meant "unlike v5"). Do you have more info (issues, docs, etc.) I could look into? I feel like I've looked through the docs, especially the migration guide, but I'm not seeing much else on this issue

@erikras
Copy link
Member

erikras commented May 23, 2016

I understand what @q42jaap means. This is a bug.

It's not particularly related to arrays. If you had a validation function like:

const validate = values => {
  const errors = {}
  if (values.newPassword !== values.confirmNewPassword) {
    errors.confirmNewPassword = 'Must match!'
  }
  return errors
}

And then you edited the newPassword field in such a way that it added or removed the error on confirmNewPassword, the <Field name="confirmNewPassword"/> won't be rerendered....but it should be!

@clayne11 is currently working on some changes (see #908) that will result in the sync validation errors being in the Redux store, which will make fixing this bug trivial.

@erikras erikras added this to the next-6.0.0 milestone May 23, 2016
@erikras erikras added the bug label May 23, 2016
@erikras erikras changed the title V6 - changes in array item field 1, do not remove error from field 2 V6 - Field does not rerender when its sync error changes May 23, 2016
erikras added a commit that referenced this issue May 23, 2016
@tnrich
Copy link
Contributor

tnrich commented May 24, 2016

I'm seeing an issue where other Fields within a FieldArray aren't re-rendered when the field array has new elements inserted/removed. Is this related to this issue or should I make a new one?

Thanks!

@erikras
Copy link
Member

erikras commented May 24, 2016

Is this related to this issue or should I make a new one?

New one. 😦

@erikras
Copy link
Member

erikras commented Jun 24, 2016

This is fixed. I will comment again when the fix is published.

@erikras erikras closed this as completed Jun 24, 2016
@tnrich
Copy link
Contributor

tnrich commented Jun 24, 2016

Thanks @erikras ! No pressure, but what's the eta on the new release?

@erikras
Copy link
Member

erikras commented Jul 1, 2016

Published in v6.0.0-rc.1.

@lock
Copy link

lock bot commented Jun 2, 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 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants