Field value type changes from array to object after child validation #726
Description
The Problem
I have a custom component that handles a list of items. This component is connected and, given a model string as prop, gets the field value from the form state to render its children.
When any of the child components is validated and has errors (rrf/setErrors), the parent field value changes from being an array [x, y, z]
to { 0: x, 1: y, 2: z }
.
This change was introduced with 1.8.1 and looks like a bug to me.
In general, is it wise to rely on the field value at all? I want this component to be reusable with a dynamic model. As alternative (and current workaround) I could extract the model value from the model state instead of the form state (e.g. with lodash.get). Or is there a simpler way while preserving the props interface (I want to avoid having to pass the model value via props as it looks redundant to me).
<EmailArrayControl model="user.emails" />
<EmailArrayControl model="company.employees[0].emails" />
Steps to Reproduce
See: http://codepen.io/jmaicher/pen/ryqPPZ
Expected Behavior
The field value remains an array [x, y, z]
.
Actual Behavior
The field value becomes an object { 0: x, 1: y, 2: z }
.