react-redux-form icon indicating copy to clipboard operation
react-redux-form copied to clipboard

Blur after form level error resets form validity

Open tomspeak opened this issue 7 years ago • 0 comments

The Problem

When I submit a form that returns an API error, I use setErrors() on the form to be displayed using the Errors component.

The issue is that, if I submit by pressing Enter, and keep the last field focussed, when blurring, the forms validity is reset, so the error message is removed.

This is very noticeable on mobile devices. To simulate the interaction on mobile, when on the Last Name field, press Return, then click anywhere within the white space. This is the same as hitting Return on a mobile device then Done on iOS to hide the keyboard to get a better view of the error.

I have looked through the documentation and old issues and cannot find anything relevant.

Steps to Reproduce

  1. Go to sandbox
  2. Focus Last Name
  3. Press Enter/Return
  4. Click white area

Expected Behavior

Blurring should not reset the form validity

Actual Behavior

Error is removed as form validity is reset.

Reproducible Code Example

Sandbox example

Happy to make a PR for this if required, would appreciate any pointers in the right direction if so.

tomspeak avatar Mar 02 '18 23:03 tomspeak