-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
[Feature Request]: Transform values on submit #418
Comments
Hey @crutchcorn, mind assigning me this for me to work on? 🙏 |
Done! Thanks for taking this on @CheRayLiu. Something worth considering is how we will/should handle TypeScript typings for transformations. |
Unassigned myself for now as I don't see myself working on it any time soon |
No worries @CheRayLiu! Thanks for being willing in the first place :) |
Just an idea for this feature. In my case, every field can have a The benefit of this is, that the typing would be a lot easier, since the Maybe that might be something worth considering implementing here as well. |
Hey @crutchcorn is this issue still up to date? If so, I think I can try to implement a small part of it. |
IMO further discussion should go into whether or not transforms on the base schema should be respected. This is how I personally would like it to work: When we define a zod schema as the validator, the form should allow default values which align with z.input See my code stackblitz: https://stackblitz.com/edit/tanstack-form-zvsfcpvd?file=src%2Findex.tsx |
Description
Ideally, I'd like to have a number, displayed as a string (say, a locale with
1,000,000
) and then transform this number back during the field submission.The text was updated successfully, but these errors were encountered: