* Adds a third argument when calling reducer plugins
This argument is the state before the redux form and other plugins reduce the action to the state provided as the first argument.
* remove extra whitespace
* Improve dirty handling for check-boxes
`dirty(undefined, false)` should be `false`. It was `true`.
Intuitively, clicking twice on a check-box should return it to
pristine, which is false atm (unless the checkbox is initialized with
`false`).
Same behavior as empty and undefined for a string.
Also decreases code complexity. If both value and initial are falsey,
return “equal true”.
Comes with tests, both immutable and plain structures are covered.
I’d call it a safe merge and would be very pleased to see it shipped.
🐣
* fix checkbox behavior
Follow up to #1762
When a checkbox is initialized with undefined or is not initialized,
`false` should be treated as `undefined` and removed from the value
tree.
It follows the convention of text fields in redux-form (‘’ value is
removed when initial is `undefined`) and follows web form checkbox
original behavior (a checkbox is checked or ‘absent’).
Of course it won’t affect forms where checkboxes are initialized with
`false` (double-clicking them will bring back `false` instead of
`undefined`, on par with text fields in redux-form)
* Add working npm example start scripts for every example
* Add instructions to run examples locally to all examples & top level md file
* Add missing backtick to local commands on each example file
* Rephrase running locally instructions for each example
`dirty(undefined, false)` should be `false`. It was `true`.
Intuitively, clicking twice on a check-box should return it to
pristine, which is false atm (unless the checkbox is initialized with
`false`).
Same behavior as empty and undefined for a string.
Also decreases code complexity. If both value and initial are falsey,
return âequal trueâ.
Comes with tests, both immutable and plain structures are covered.
Iâd call it a safe merge and would be very pleased to see it shipped.
🐣
* Add clearErrorsOnChange config property to reduxForm() (#1708)
* Make clearErrorsOnChange also affect global errors (#1708)
* Fix clearing old global errors on stopSubmit (#1708)
* Global errors were always not cleared by stopSubmit
* Clearing field submit errors was not tested
* Rename (and invert) clearErrorsOnChange to persistentSubmitErrors (#1708)
* Fix submit not working when persistentSubmitErrors is enabled and there are old submit errors (#1708)
* Fix lint errors
Optimized for the most common use-case: path length of 1, 2 or 3 items
On my chrome it shows ~5x improvement
jsPerf is down, so here's a benchmarkJS fiddle:
https://jsfiddle.net/9vqm86eu/1/
* Add documentation about enableReinitialize to InitializeFromState.md example
* Rewrite initialize section to include 'keepDirtyOnReinitialize' & 'INITIALIZE'
* Make the reinitialization section more readable with an ordered list
* Fix typos in InitializeFromState.md
* Add source code links on /api docs for each section block
* Remove trailing spaces on various lines on api/README.md
* Add source code link to api/ActionCreators.md
* Add source code link to api/Field.md
* Add source code link to api/FieldArray.md
* Add source code link to api/Fields.md
* Add source code link to api/FormValueSelector.md
* Add source code link to api/Props.md
* Add source code link to api/Reducer.md
* Add source code link to api/ReducerPlugin.md
* Add source code link to api/ReduxForm.md
* Add source code link to api/Selectors.md
* Add source code link to api/SubmissionError.md
* Add a section for Selectors in api/README.md to link to the new Selectors.md
* Separate source links for reducer & reducer.plugin on api/README.md
* Reformat source code link for reducer.plugin to be aligned with the rest of the block
* Fix broken link to proptypes.js in props documentation
* Fix broken link to reduxForm() api docs in the props api docs
* Fix image source url for life cycle page in the docs
* Redo fix for ValueLifecycle image source with better raw github url