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

Use parse instead of format when calculating checked

Open jharding opened this issue 3 years ago • 2 comments

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!

jharding avatar Feb 14 '22 23:02 jharding

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

codesandbox-ci[bot] avatar Feb 14 '22 23:02 codesandbox-ci[bot]

I'm not a maintainer, just interested in this PR as I stumbled upon it due to this bug #560

nkappler avatar Apr 14 '22 20:04 nkappler