davidkpiano / react-redux-form

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

RRF validates against pre-parsed value rather than parsed value #1149

Open Gidgidonihah opened 6 years ago

Gidgidonihah commented 6 years ago

The Problem

The validators don't seem to take the parser into account

Steps to Reproduce

Create a number input with a max of 99 and a parser that only ever allows 2 numbers. If you press 123 while focused on the input, the input will show 12 as the value, but the form will be invalid.

Expected Behavior

The form should validate using the parsed result

Actual Behavior

The form appears to validate using the last input, rather than the parsed result from the last input.

Reproducible Code Example

https://codepen.io/Gidgidonihah/pen/pVVaNg

Note that the button is disabled when the form is invalid and the disabled button is red. If you remove the disabled line. Also note that change is not triggered on the form after the 3 is pressed.