React-final-form: Initial Values to form override Initial Value to field

Created on 1 Jul 2020  路  4Comments  路  Source: final-form/react-final-form

Are you submitting a bug report or a feature request?

Bug Report

What is the current behavior?

Initial Values provided to form override Initial Value to a field

What is the expected behavior?

Initial Value provided to field should override the form (exactly the opposite)

Sandbox Link

Sandbox Link

What's your environment?

"final-form": "^4.20.0",
"react-final-form": "^6.5.0",
Browsers: Chrome 83.0.4103.116, Firefox 77, 80 (browser independent I think)
(Node: 12.18 OS: Win 10 (1909))

Most helpful comment

You are right @Noisycall .

From FinalForm Docs The value given here will override any initialValues given to the entire form. and this was not happen.

This bug caused by registerField method in final-form package, if I was right it's on this line of code. while form initialize field will not be initialized. @erikras please correct me and if it possible to guide me to solve this. I'm Able to open PR for this

All 4 comments

You are right @Noisycall .

From FinalForm Docs The value given here will override any initialValues given to the entire form. and this was not happen.

This bug caused by registerField method in final-form package, if I was right it's on this line of code. while form initialize field will not be initialized. @erikras please correct me and if it possible to guide me to solve this. I'm Able to open PR for this

same problem (

Could we somehow retain both behaviors? I'm working off the situation where my fields have default values which are used when there is no form-level initial values, i.e. the first time a user sees the form. Once the user changes and saves some values for later (without submitting yet), I want these to take precedent when the user is back working on the form. Hope this makes sense.

Having exactly the same problem

Was this page helpful?
0 / 5 - 0 ratings