-
Notifications
You must be signed in to change notification settings - Fork 7
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
Allow check fields and selectable fields to render as required #487 #581
base: master
Are you sure you want to change the base?
Conversation
47bcb52
to
0f3b935
Compare
I think the feature is good (we need it and we know why), but honestly the docs are very confusing to me. I think we should talk about it before merging - I will schedule this for our Monday meeting. |
I am approving this as it is fine for me. But I might be influenced by the reason for this change. But it is true that one more sentence could be helpful. I am missing the detailed explanation why would user might need this and why it is correct approach. |
Users may find themselves in a situation where the input is not required (i.e. making the input checked), but they also don't want to render the field as optional because not choosing an option can be perfectly valid. For this case, there is the `renderAsRequired` prop. This affects `CheckboxField`, `Radio`, `SelectField`, and `Toggle`. Closes #487
0f3b935
to
7a65aab
Compare
@@ -186,6 +186,76 @@ React.createElement(() => { | |||
}); | |||
``` | |||
|
|||
### Required State |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions:
- emphasize it's just a visual thing
- when a checkbox can be true or false, not only true
- consider moving it aside as an edge case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
Users may find themselves in a situation where the input is not required (i.e. making the input checked), but they also don't want to render the field as optional because not choosing an option can be perfectly valid. For this case, there is the
renderAsRequired
prop.This affects
CheckboxField
,Radio
,SelectField
, andToggle
.Closes #487.