Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a initial form state before creating fields #1259

Merged
merged 1 commit into from
Sep 2, 2016

Conversation

yesmeck
Copy link
Contributor

@yesmeck yesmeck commented Jul 1, 2016

This should fix the long living bug #621.

First round

My first try was #1025, I tried pass a default field state to updateField so that updateField can read initial value from given state.

But I forgot the the validate function which causes validate function cann't read initial values at first render.

Second round

My second try was #1061, I tried pass initial values to validate function. But I forgot a form may have no initial values or only have partial initial values which causes #1241.

Third round

I thought I can create a initial form state before creating fields, so that updateField and validate function can both read initial values.

@yesmeck yesmeck force-pushed the fix-initial-values branch 2 times, most recently from 9829afc to 2ae07f2 Compare July 1, 2016 16:49
@codecov-io
Copy link

codecov-io commented Jul 1, 2016

Current coverage is 97.12%

Merging #1259 into master will increase coverage by 0.01%

@@             master      #1259   diff @@
==========================================
  Files            73         74     +1   
  Lines          4121       4140    +19   
  Methods         769        771     +2   
  Messages          0          0          
  Branches        315        317     +2   
==========================================
+ Hits           4002       4021    +19   
  Misses          119        119          
  Partials          0          0          

Powered by Codecov. Last updated by 056d9f9...0abc5e7

This should fix the long living bug redux-form#621.

First round
===========

My first try was redux-form#1025, I tried pass a default field state to [updateField](https://github.com/erikras/redux-form/blob/v5.3.1/src/updateField.js#L8) so that updateField can read initial value from given state.

But I forgot the the validate function which causes validate function cann't read initial values at first render.

Second round
============

My second try was redux-form#1061, I tried pass initial values to validate function. But I forgot a form may have no initial values or only have partial initial values which causes redux-form#1241.

Third round
=====================

I thought I can create a initial form state before creating fields, so that updateField and validate function can both read initial values.

Hope this is the last round.
@erikras erikras changed the base branch from master to v5 September 2, 2016 06:36
@erikras erikras merged commit 994471a into redux-form:v5 Sep 2, 2016
@yesmeck
Copy link
Contributor Author

yesmeck commented Sep 2, 2016

@erikras Could you create a v5 label for v5 issues?

@erikras
Copy link
Member

erikras commented Jan 6, 2017

Published in v5.3.4.

@lock
Copy link

lock bot commented Jun 1, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants