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

[Bug]: Can't use some Zod Schema for form validation #118

Open
GuilhermeAmado opened this issue Aug 23, 2023 · 3 comments
Open

[Bug]: Can't use some Zod Schema for form validation #118

GuilhermeAmado opened this issue Aug 23, 2023 · 3 comments
Labels
bug Something isn't working needs triage Needs attention from the HouseForm maintainers

Comments

@GuilhermeAmado
Copy link

Steps To Reproduce

If the schema has a super refine, it loses its shape and we can't do this. Any solutions?

  1. Create a zod schema that has super refine
  2. Try to use schema for field validation using onChangeValidate
  3. The "shape" propriety will be missing
  4. Impossible to validate field

Expected Behavior

I think this is a Zod limitation but it should be provided another way to validate a form based on a zod schema.

Reproduction link

No response

HouseForm Version

v1.11.0

React Version

v17.0.2

Zod Version

3.20

Environment

Browser (Chrome/Firefox/Safari/etc)

More details

No response

@GuilhermeAmado GuilhermeAmado added bug Something isn't working needs triage Needs attention from the HouseForm maintainers labels Aug 23, 2023
@crutchcorn
Copy link
Member

I'm admittedly not super familiar with super refine. Could you provide a sample bit of code or repro link? :)

@GuilhermeAmado
Copy link
Author

GuilhermeAmado commented Aug 29, 2023

I'll provide a repro link as soon as I can. Sorry, I have been very busy =/
Is there any chance that a full form schema validation could be implemented?
Maybe we could pass a zod schema as a prop to the Form component.

@crutchcorn
Copy link
Member

Is there any chance that a full form schema validation could be implemented?
Maybe we could pass a zod schema as a prop to the Form component.

Not for this project. There's technical limitations with this API.

However, this is being fixed in my work for TanStack Form

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Needs attention from the HouseForm maintainers
Projects
None yet
Development

No branches or pull requests

2 participants