-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Boolean option for RadioButtonGroup #294
Comments
any PR is welcome |
I found a workaround For the example optionsArray mentioned above, we can do the following
The only problem is react-hook-form/react-hook-form#2323 For this, we can avoid using required in rule as well as prop and use validate function in the rule instead. We will have to add the asterisk in the label manually. I wanted to add boolean type inbuilt but then due to the above mentioned git issue, required rule and prop will stop working |
I really think you make yourself too much trouble: either use a checkbox / switch which handle true/false natively or use "0" "1" and just cast the value shortly before you persist it in the database inside your |
Yes we can do that if there is only a form that we are building. But I am building a form configurator and I cannot have such restrictions that a user cannot configure boolean values through it. The above solution works for now. |
Duplicates
Latest version
Summary 💡
Currently RadioButtonGroup Element supports string and number. But if I want to use a Yes/No radio button which should store true/false its not working.
Example optionsArray : [{"id":true,"value":"Yes"},{"id":false,"value":"No"}]
If for reducing complexity there is a way that the options have string true/false values and then the value gets stored as boolean that would also be fine
Examples 🌈
No response
The text was updated successfully, but these errors were encountered: