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

Do not clear errors unless field is being removed from the form #3064

Merged
merged 2 commits into from Jun 16, 2017

Conversation

tikotzky
Copy link
Contributor

Currently errors will be cleared every time an UNREGISTER action is fired even if the count is greater than 1.

This would cause the errors to get cleared even when there is still a form field on the page.
you can see a demo of the error here

This PR changes the behavior so that errors will only be cleared if the count is <= 0 and the field is actually being removed from the registeredFields

These tests asserts that error should only be cleared when unregistering is causing the field to be removed, not when its just decrementing the count.
@codecov-io
Copy link

codecov-io commented Jun 15, 2017

Codecov Report

Merging #3064 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3064   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          68      68           
  Lines        1452    1451    -1     
======================================
- Hits         1452    1451    -1
Impacted Files Coverage Δ
src/createReducer.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6f46ac...71026cd. Read the comment docs.

Copy link
Collaborator

@gustavohenke gustavohenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks! The changes LGTM 👍

Do you know whether we have an issue for this?
I'm pretty sure I've seen such issue in the past, just asking because you may have stumbled on it.

@tikotzky
Copy link
Contributor Author

Thanks!
Not aware of any specific issue. I uncovered this bug while looking into #2742

@erikras
Copy link
Member

erikras commented Jun 16, 2017

Excellent work. Man, I really ❤️ CodeSandbox. It was so easy for you to clearly demonstrate this bug.

@erikras
Copy link
Member

erikras commented Jul 11, 2017

Published in v7.0.0.

@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

Successfully merging this pull request may close these issues.

None yet

4 participants