Closed horodnicdragos closed 3 years ago
Hi @horodnicdragos I have experienced the same issue when creating my custom templates. I cannot access the AutoForm.getFieldValue correctly because the template.data.name property does not update.
If you find any solution or clue, please, let me know. Thanks
I am using afArrayField with two fields using properties from the same collection (Fa). The collection has nested values and on the second field of the form (fi.$.uni), it returns an option list depending on the selected value from the first field (fi.$.fac).
Everything works well, until I remove on of the array's elements by clicking the '-' button. Afterwards the second field will not show the corresponding options. I did find something that I hope to be helpful.
First of all, here is my schema:
Template:
{{> afArrayField name='fi' fields="fi.$.uni, fi.$.fac"}}
After some brief debugging. it appears that @name does not update on array removal. Here is an example: I have the following name values for two elements in the array:
fi.0.fac fi.1.fac
I add another one:
fi.0.fac fi.1.fac fi.2.fac
I remove the middle element and what remains is:
fi.0.fac fi.2.fac
Adding another element will result in:
fi.0.fac fi.2.fac fi.3.fac
I am pretty sure this is the cause of not being able to reactively alter options list after removing an element from the array.