Visibility logic #1270
-
I think it would be appropriate to add Visibility logic to fields <form.Field
conditional={[(form: FormApi): boolean => {
return true;
}, ['fieldname', 'fieldname2']]}
/> This feature should affect both rendering and validation. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You could build this into your subfields when building your composable fields. You could add an extra prop for is visible then within the subcomponent render null when not visible. Take a look at my Full Name field definition in this example: |
Beta Was this translation helpful? Give feedback.
You could build this into your subfields when building your composable fields. You could add an extra prop for is visible then within the subcomponent render null when not visible.
Take a look at my Full Name field definition in this example:
https://stackblitz.com/edit/tanstack-form-dowbrasw?file=src%2Ffeatures%2Fpeople%2Fpage.tsx