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

Fields can be initially empty/undefined #2

Closed
MiroslavPetrik opened this issue Feb 5, 2023 · 3 comments
Closed

Fields can be initially empty/undefined #2

MiroslavPetrik opened this issue Feb 5, 2023 · 3 comments

Comments

@MiroslavPetrik
Copy link
Member

Currently the checkbox, radio or number fields are strict, so they always contain value of boolean, string or number respectively.

Usually, when field is untouched:

  • none of radio buttons should be checked
  • number field should be empty like text field with empty string instead of displaying 0

Use Cases

  • yes/no radio: when the form requires explicit user input, it must start with undefined radio value, so error message forces the user to pick one of options
@MiroslavPetrik
Copy link
Member Author

For empty values we will use undefined as that plays with zod - when zod has undefined value, the required_error message is being used.

Furthermore, builder pattern can be applies for fieldAtom creation, to get better DX on the validation api.

@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0-next.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant