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

Fix asyncValidate when asyncBlur/ChangeFields are provided #3647

Merged
merged 1 commit into from
Nov 30, 2017

Conversation

jedrzej-bridgemaker
Copy link
Contributor

Check if either asyncBlurFields or asyncChangeFields are provided. If neither is, trigger validation. If any is, need to check if the blurred/changed field is on the corresponding list.
Fixes #3645

@codecov-io
Copy link

codecov-io commented Nov 29, 2017

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3647   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          70      70           
  Lines        1574    1577    +3     
======================================
+ Hits         1574    1577    +3
Impacted Files Coverage Δ
src/createReduxForm.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 56a2984...85bb34e. Read the comment docs.

@erikras erikras merged commit c1fc3ef into redux-form:master Nov 30, 2017
@erikras
Copy link
Member

erikras commented Nov 30, 2017

Nicely done.

~asyncBlurFields.indexOf(name.replace(/\[[0-9]+\]/g, '[]'))
const fieldNeedsValidationForChange =
asyncChangeFields &&
~asyncChangeFields.indexOf(name.replace(/\[[0-9]+\]/g, '[]'))
Copy link
Contributor

@ericbiewener ericbiewener Dec 4, 2017

Choose a reason for hiding this comment

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

@shepmaster pointed out on a PR of mine that asyncValidate gets called in one location without any arguments, causing name.replace to throw an error. Although this code has now been modified, I expect this to still be an issue on lines 679 & 682.

@erikras
Copy link
Member

erikras commented Jan 18, 2018

Published in v7.2.1.

@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