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

Async blur validation not triggered after changes done by field-level validation #4529

Open
lpeliberty opened this issue Sep 5, 2019 · 0 comments
Milestone

Comments

@lpeliberty
Copy link

lpeliberty commented Sep 5, 2019

Are you submitting a bug report or a feature request?

Bug

What is the current behavior?

Imagine we have a field with a field-level validation and an async blur validation : when a field-level validation update the error status, the async validation is not called. It could be good only if the update made by the field-level validation have found an error, not when the error is removed !

What is the expected behavior?

Async blur validation should be called if Field-level validation does not detect an error.

Sandbox Link

https://codesandbox.io/embed/redux-form-template-5961u

Example : type 'paul' in username field. At the end, blur is triggered but in redux devtools, we only saw action @@redux-form/UPDATE_SYNC_ERRORS and not @@redux-form/START_ASYNC_VALIDATION

Why ? Because, if the username length is not equal to 4, there's an error. So the first type you type p, the error invalid length is updated in store form.fieldLevelValidation.syncErrors.username. When you type a and u, the state does not change and after that, when you type l, the state is updated and set the error in form.fieldLevelValidation.syncErrors.username to null. And it seems that this behavior blocks the async blur validation because a change is done.

What's your environment?

Latest redux-form 8.2.6

@renatoagds renatoagds added bug c:field-level-validation validation in field component labels Sep 25, 2019
@renatoagds renatoagds added this to the v8.3.1 milestone Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants