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]: Autoform doesn't preprocess enums properly #1072

Open
1 of 2 tasks
marr opened this issue Feb 27, 2025 · 0 comments
Open
1 of 2 tasks

[Bug]: Autoform doesn't preprocess enums properly #1072

marr opened this issue Feb 27, 2025 · 0 comments
Labels
autoform Automatically generate a form from Zod schema bug Something isn't working

Comments

@marr
Copy link

marr commented Feb 27, 2025

Reproduction

https://gist.github.com/marr/fd74158b1ce07b299584520eb01f01fd

Describe the bug

The z.enum type appears to not resolve correctly when using preprocess. The value set in initialValues should be resolved to whatever is returned from the preprocess function. I see the value in the form, but it fails to match anything defined in the enum.

System Info

.

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@marr marr added the bug Something isn't working label Feb 27, 2025
@zernonia zernonia added the autoform Automatically generate a form from Zod schema label Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autoform Automatically generate a form from Zod schema bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants