-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Pickers should have isRequired
property
#6636
Comments
@joschect ever considered adding 'required' to pickers? |
@micahgodbolt @joschect DatePicker already has BTW, because the required property in DatePicker is named |
isRequired
propertyisRequired
property
@tsekityam yes to consistency, but the opposite direction. We've been transitioning any 'isRequired' or 'isDisabled' to their html attribute name for consistency. So we'll probably deprecate isRequired on date picker and make 'required' the value for all of them. |
Would we just want pickers required to act just like a textfield required? I do think it makes sense to add it. |
Seeing lots of issues that might be resolved by separating the control from the control inside of a form. If we add required, do we also need to add error messages? It'd be nice to abstract error messaging and make sure that each control supports a required visual variation |
might be work bundled into #5582 |
I think Wrapping a form component could work well IE new component <Validate
isError={isError}
errorType={errorTypeEnum}
errorMessage={props => someUtilFunc(props)}
>
<TextField
label="Title"
value={value}
styles={props => ({
fieldGroup: props.isError ? { background: "red" }
})}
/>
<DatePicker
{...datePickerProps}
/>
</Validate> This way we can have one component that can check a group of inputs, helps reduce re-rendering/unnecessary duplication.
I find that base input components that naturally change layout dimensions is bad practice and can cause unnecessary re-renders so keeping it out of the base components would be my preference. It's the reason I've avoided the description prop. |
When we can have the required propertyfor the BasePicker? Iit's really limiting not having it. |
Closing this in favor of #3620. |
Describe the feature that you would like added
Add ability to mark any picker as a required field
What component or utility would this be added to
Pickers
Have you discussed this feature with our team, and if so, who
No.
Additional context/screenshots
The text was updated successfully, but these errors were encountered: