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

$form.valid is false when async error appears on any form field #1224

Open NNSTH opened 4 years ago

NNSTH commented 4 years ago

The Problem

We use this package for a lot of forms, managed it very well, but still stacked with this issue: when we try to enable / disable "submit" button according to form validation state- $form.valid is false although no client errors appear, only server error (that we added via "asyncSetValidation"). is there any way to make a difference between "client valid" and "server valid"?

Steps to Reproduce

  1. Create a form using RRF
  2. Use simple Field component, and use client validation like "required".
  3. add onSubmit validation and use asyncSetValidation to raise server validation error.
  4. Fill in this field so required will not raise client error.

Expected Behavior

$form.valid is true

Actual Behavior

$form.valid is false

Reproducible Code Example

(please fork from this CodePen template or this CodeSandbox template)