Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FieldArray helper properties to accumulate subfield data #7

Open
crutchcorn opened this issue Feb 2, 2023 · 2 comments
Open

Add FieldArray helper properties to accumulate subfield data #7

crutchcorn opened this issue Feb 2, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@crutchcorn
Copy link
Member

crutchcorn commented Feb 2, 2023

Just like the form has isDirty, isTouched, and isValid properties that are generated from all fields, it would be cool to see the ability to pass the following to the FieldArray for all FieldArrayItems:

  • areFieldsDirty
  • areFieldsTouched
  • fieldErrors
  • areFieldsValid

To make this portion of code performant, we should make sure to use a similar trick to the one we're using with Form to see if a given field is used or not:

https://github.com/crutchcorn/houseform/blob/main/lib/form/use-formlike.ts#L84-L87

@crutchcorn crutchcorn added enhancement New feature or request good first issue Good for newcomers labels Feb 2, 2023
@AlexChadwickP
Copy link

Just for clarification would the areFieldsDirty for instance return true if any field is dirty or if all fields are dirty?

@crutchcorn
Copy link
Member Author

If any fields are dirty - similar to how <Form> works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants