When a boolean flag like touched is set on a form instance, it may be useful to know which field(s) contribute to that. It can be done by iterating through all fields and checking the flag on each of them, but there could be a more conventient way. There are special properties listing the fields for each flag, already available on the form instance:
touchedFields: an array of field names that have the touched flag
dirtyFields: an array of field names that have the dirty flag
invalidFields: an array of field names that have the invalid flag
validatingFields: an array of field names that have the validating flag
visitedFields: an array of field names that have the visited flag
modifiedFields: an array of field names that have the modified flag
focusedField: the field names that currently has focus
When a boolean flag like
touched
is set on a form instance, it may be useful to know which field(s) contribute to that. It can be done by iterating through all fields and checking the flag on each of them, but there could be a more conventient way. There are special properties listing the fields for each flag, already available on the form instance:touchedFields
: an array of field names that have thetouched
flagdirtyFields
: an array of field names that have thedirty
flaginvalidFields
: an array of field names that have theinvalid
flagvalidatingFields
: an array of field names that have thevalidating
flagvisitedFields
: an array of field names that have thevisited
flagmodifiedFields
: an array of field names that have themodified
flagfocusedField
: the field names that currently has focus