Open KateChanthakaew opened 2 weeks ago
Hi Kate. It looks like that only happens when the child is a Product (Or the other way around like you said?) is that right? If i replace the product with a single string it looks like it works.
I added your repro as an example, and added a first unit test here: https://github.com/AlexMouton/rescript-fields/pull/new/array-product
The unit test doesn't seem to capture the issue, if you want to look at it.
@AlexMouton Thanks for your response. I'll take a look and let you know.
Description
Calling
Form.use(. ~init=None, ...)
or withForm.use(. ~init=Some([]), ...)
, notice the FieldArray elements are not updating as expected.Reproduction
We create a
FieldArray
namedLoginArray
to contain the fieldLogin
as the nested elements. Our example below is driven from theFieldArray
example found inEverything.res
.Note: The bug occurs when a
FieldArray
is nested inside aFieldProduct
, and also when aFieldProduct
is the element inside aFieldArray
. The issue occurs forfilterIdentity
andfilterGrace
typeFieldArray
, however we're just showing thefilterIdentity
version with a Form.use(. ~init=Some([]), ...) in our example below.~init=None
, we show there is a validonChange
with atarget[value]
but the field does not receive the changed values.https://github.com/user-attachments/assets/8562726c-fc62-40d1-879d-3721bd7fbbf1
~init=Some([ ])
, updating the FieldArray element's fields does not propagate the changes to theFieldArray
parent.https://github.com/user-attachments/assets/a7f387c8-6c8c-4dbf-97cc-ad5bd115de76
Expected Behavior
form.field
and itsFieldArray
elements to store their updated values on afield.actions.set(value).