When typing in the form input fields, there is a target["value"] for every key stroke, but as seen by the form's show method logs, form.field->Field.show no updates are being stored to the form.
form.field should always update when input field.action.set(value) is called.
Working Example
If we provide Form.use(.~init=Some(Field.input), ...) and the FieldType is not FieldArray, the form is working as expected. FieldArray's bugs will be noted in a different git-hub issue.
let init: Field.input = {
username: "",
password: "",
}
let form = `Form.use(.`
~context=contextValidate,
~init=some(init),
~validateInit=false,
)
Description
When a user supplies an
~init=None
, subsequent updates made to the form viafield.actions.set(value)
do not result in form Store updates or changes.Reproduction
Example File: rescript-fields/examples/login/Login.res
Using the example files and documentation, calling a
field.actions.set()
from anonChange
is not setting values to the form.Form Instantiation:
Handler Verification:
When typing in the form input fields, there is a
target["value"]
for every key stroke, but as seen by the form'sshow
method logs,form.field->Field.show
no updates are being stored to the form.VDO:
https://github.com/user-attachments/assets/928b7379-eb26-48bc-8d3a-cb9b72c48ddd
Expected Behavior
form.field
should always update when inputfield.action.set(value)
is called.Working Example
If we provide
Form.use(.~init=Some(Field.input), ...)
and the FieldType is notFieldArray
, the form is working as expected.FieldArray
's bugs will be noted in a different git-hub issue.VDO:
https://github.com/user-attachments/assets/09c234fc-b8bb-4ed0-b3d1-6cee6891a260