Use parse instead of format when calculating checked
This may be an incorrect assumption, but it seems like the getter for checked should be using parse, not format when comparing values. In addition to fixing an issue I was experiencing, the TypeScript definitions suggest this should be the intended behavior as well as parse returns FieldValue and state.config is of the type FieldValue.
I added a couple of tests to prevent future regressions – please let me know if there's anything else I should do to get this to a state where you'd be comfortable accepting the patch.
Thanks for the great library!
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 9839445df1b21beff981bd88e8e7ea900c79319d:
| Sandbox | Source |
|---|---|
| React Final Form - Simple Example | Configuration |
| React Final Form - Synchronous Record Level Validation | Configuration |
| React Final Form - Synchronous Field Level Validation | Configuration |
| final-form/react-final-form | Configuration |
| React Final Form - Subscriptions Example | Configuration |
I'm not a maintainer, just interested in this PR as I stumbled upon it due to this bug #560