How to use a checkbox/switch element with useZorm? #62
yamilelias
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a form that uses an on/off switch as part of the form. However, the form never seems to trigger the
onValidSubmit
function whenever I try to add it. It doesn't matter the switch state. This is my form:formSchema.ts
ScreenForm.tsx
Switch.tsx
I have no issues with other types of inputs, just with this one. However, the documentation is not clear enough for me to understand what is going on with the switch input type. I'm sending all the props to the
checkbox
input type. This is bugging me because I need to add it to the form, but the only solution I've found is to control the inputs using a state. However, this goes against Zorm's mission.If anyone has a clue that could guide me, I'd really appreciate it. Also, if someone else gets into the same situation, I'm willing to open a PR to update the docs to include this.
Beta Was this translation helpful? Give feedback.
All reactions