Avoids potential mismatch from passing fields into the form constructor (i.e. adding a field requires changes in two place)
const form = createForm()
const email = form.field()
The current constructor is still there for the time being but will likely be removed along with the option to create a field that isn't associated with a form (i.e.createField())
Also adds support for dynamic fields - only fields with HTML Input elements in the DOM contribute to the form validity state. So if the input of an email can be toggled, it won't prevent the form being submitted, but can require validation if present.
Avoids potential mismatch from passing fields into the form constructor (i.e. adding a field requires changes in two place)
The current constructor is still there for the time being but will likely be removed along with the option to create a field that isn't associated with a form (i.e.
createField()
)Also adds support for dynamic fields - only fields with HTML Input elements in the DOM contribute to the form validity state. So if the input of an email can be toggled, it won't prevent the form being submitted, but can require validation if present.