Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1198 from ngbrown/ngbrown-patch-1
Browse files Browse the repository at this point in the history
Fix async validators capturing and overwriting validation results
  • Loading branch information
davidkpiano authored Jan 5, 2019
2 parents 85f60e8 + 805b083 commit 7de6a58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/control-component-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ function createControlClass(s) {

mapValues(asyncValidators, (validator, key) => {
const outerDone = (valid) => {
const validity = i.merge(fieldValue.validity, { [key]: valid });
// get current fieldValue as another validator may have already been processed.
const currentFieldValue = this.props.fieldValue;
const validity = i.merge(currentFieldValue.validity, { [key]: valid });

dispatch(actions.setValidity(model, validity));
};
Expand Down

0 comments on commit 7de6a58

Please sign in to comment.