You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repository and believe that this is not a duplicate.
What problem does this feature solve?
This issue will cover four topics.
Adding getAllFieldNames prop to useForm (form instance). [priority low]
Modifying isFieldTouched and isFieldsTouched [priority high]
Adding isFieldVisited and isFieldsVisited props. [priority high]
Adding isFieldValidated and isFieldsValidated props [priority high]
Some more advanced (and useful) features could be implemented with the form instance.
Adding getAllFieldNames prop to useForm (form instance).
var listOfFieldNames = formInstance.getAllFieldNames();
This would help reduce hard-coded attempts to build a list of field names. A list of field names is required for the majority of the form instance props. If a field is changed within the form, we usually face having to modify a hard-coded list if we use any of the form instance props. This might not be as important of a problem to address, but would drastically improve usability of the form instance. This would be a modification to rc/field-form I believe.
Modifying isFieldTouched and isFieldsTouched
While experimenting with the usage of the isFieldTouched and isFieldsTouched, I found that 'touched' in this context really means 'modified'. For example, if I tab through all of the fields on a form, isFieldsTouched will be false. I suggest that isFieldTouched and isFieldsTouched should be renamed to isFieldModified and isFieldsModified respectively. This makes more semantic sense when referencing functionality of this feature, which leads me to number 3.
Adding isFieldVisited and isFieldsVisited props.
Currently, there is no way to tell if a field has been visited (which is originally what I thought isFieldTouched did). Adding this prop to form instance would allow full semantic coverage of what was confusing about isFieldTouched. This prop would perhaps keep track of the blur event of each field and if it has fired (not if it has been modified or not).
Adding isFieldValidated and isFieldsValidated props [priority high]
This would allow a check if a field has been previously validated already.
What does the proposed API look like?
The API would be similar to how the form instance props work, just modifying functionality of isFieldTouched and isFieldsTouched as well as adding a getAllFieldNames, isFieldVisited, isFieldsVisited, isFieldValidated, and isFieldsValidated props.
The text was updated successfully, but these errors were encountered:
Note: I can contribute to making this feature request possible. I might need some pointers on where to start since I haven't contributed to antd (or rather rc/field-form before).
What problem does this feature solve?
This issue will cover four topics.
getAllFieldNames
prop to useForm (form instance). [priority low]isFieldTouched
andisFieldsTouched
[priority high]isFieldVisited
andisFieldsVisited
props. [priority high]isFieldValidated
andisFieldsValidated
props [priority high]Some more advanced (and useful) features could be implemented with the form instance.
getAllFieldNames
prop to useForm (form instance).var listOfFieldNames = formInstance.getAllFieldNames();
This would help reduce hard-coded attempts to build a list of field names. A list of field names is required for the majority of the form instance props. If a field is changed within the form, we usually face having to modify a hard-coded list if we use any of the form instance props. This might not be as important of a problem to address, but would drastically improve usability of the form instance. This would be a modification to rc/field-form I believe.
isFieldTouched
andisFieldsTouched
While experimenting with the usage of the isFieldTouched and isFieldsTouched, I found that 'touched' in this context really means 'modified'. For example, if I tab through all of the fields on a form, isFieldsTouched will be false. I suggest that
isFieldTouched
andisFieldsTouched
should be renamed toisFieldModified
andisFieldsModified
respectively. This makes more semantic sense when referencing functionality of this feature, which leads me to number 3.isFieldVisited
andisFieldsVisited
props.Currently, there is no way to tell if a field has been visited (which is originally what I thought
isFieldTouched
did). Adding this prop to form instance would allow full semantic coverage of what was confusing aboutisFieldTouched
. This prop would perhaps keep track of the blur event of each field and if it has fired (not if it has been modified or not).isFieldValidated
andisFieldsValidated
props [priority high]This would allow a check if a field has been previously validated already.
What does the proposed API look like?
The API would be similar to how the form instance props work, just modifying functionality of
isFieldTouched
andisFieldsTouched
as well as adding agetAllFieldNames
,isFieldVisited
,isFieldsVisited
,isFieldValidated
, andisFieldsValidated
props.The text was updated successfully, but these errors were encountered: