davidkpiano / react-redux-form

Create forms easily in React with Redux.
https://davidkpiano.github.io/react-redux-form
MIT License
2.07k stars 251 forks source link

Fix async validators capturing and overwriting validation results #1198

Closed ngbrown closed 5 years ago

ngbrown commented 5 years ago

I noticed that when there are two or more asyncValidators, the last one calling done() overwrote the results of all validators that finished before.

The reason was that fieldValue was captured when the validators were kicked off, and then merged at done() (outerDone() in the code), even if they had changed.

This also resolves #1013.

ngbrown commented 5 years ago

Codepen that uses new version and shows shows that #1013 is fixed: https://codepen.io/ngbrown/pen/JwLrPe. Reproduce steps from #1013 with both original and new codepen.

davidkpiano commented 5 years ago

Published as 1.16.12

ngbrown commented 5 years ago

Thanks for getting a release out so quickly. :)