mobx-react-form icon indicating copy to clipboard operation
mobx-react-form copied to clipboard

form.update() problem with array of objects having 'value' property

Open AndrewGulidov opened this issue 9 years ago • 1 comments

Hello. If I want to populate a field with an array of objects it works fine in almost all cases. But if an object has property named 'value' something strange happens. For example if I have a following array:

[{id:1, name 'name'}]

after form.update({arrayField: array}) in the arrayField's value I have the passed array, But if we have an array like following:

[{id:1, name 'name', value: 'some value'}]

after form.update({arrayField: array}) in the arrayField's value I have 'some value' instead of an array. The same result if I try to use add() instead of update. If it is an expected behavior, could you please let me know, how can I populate the array field with this kind of object?

Thanks in advance.

AndrewGulidov avatar Sep 11 '17 21:09 AndrewGulidov

I replicated and found the issue, but I have to test it more.

Thank You for reporting this.

foxhound87 avatar Sep 13 '17 08:09 foxhound87