final-form / final-form/react-final-form

validateOnBlur is ignored with the setFieldData mutator

Open
#973 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

Hi,

The `validate` method is called on each change from the moment I use the `setFieldState` mutator, no matter if there is a `validateOnBlur` or not.

### What is the current behavior?

Validate called on each change.

### What is the expected behavior?

Validate should be called only at onBlur.

### Sandbox Link

https://codesandbox.io/s/nifty-keller-merlg

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior in the linked CodeSandbox, then trace how the setFieldData and setFieldState mutators interact with validateOnBlur. Check the existing validation tests and add coverage showing that validation runs on blur rather than on every change; done means the reported case follows the expected timing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.