shadcn-vue
shadcn-vue copied to clipboard
[Bug]: Autoform REQUIRES dependencies does not work as advertised
Reproduction
https://gist.github.com/marr/4c2485976a8d067cd13654cd11ed3e5a
Describe the bug
When Toggling a fields REQUIRES dependency, the form state fails to enforce the required value.
I read the documentation about making the field optional using z.optional() first. When the dependency runs, I see the field render as if it was required (add the * next to the label), but the form is still submittable and contains no errors when leaving the required field empty. I have tried with both enum and string types and they exhibit the same behavior.
System Info
.
Contributes
- [x] I am willing to submit a PR to fix this issue
- [ ] I am willing to submit a PR with failing tests