-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[InputLabel] Remove FormLabelClasses in favor of asterisk class #14504
Conversation
@@ -141,7 +142,7 @@ InputLabel.propTypes = { | |||
children: PropTypes.node, | |||
/** | |||
* Override or extend the styles applied to the component. | |||
* See [CSS API](#css-api) below for more details. | |||
* See [CSS API](#css) below for more details. |
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.
Nice finding!
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.
We should fix all the other links (+100)
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.
@oliviertassinari thanks for reviewing. Should I make separate PR for this?
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.
Yes, it would be awesome!
Well done! |
Thanks for reviewing my PR. This is my first PR in material-ui, I would like to contribute more. Thanks for your support. |
@@ -86,7 +88,6 @@ function InputLabel(props) { | |||
classes, | |||
className, | |||
disableAnimation, | |||
FormLabelClasses, |
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.
This is a breaking change now.
@@ -1048,7 +1048,7 @@ const PopoverTest = () => <Popover open ModalClasses={{ root: 'foo', hidden: 'ba | |||
|
|||
const InputLabelTest = () => ( | |||
<InputLabel | |||
FormLabelClasses={{ | |||
classes={{ | |||
root: 'foo', | |||
asterisk: 'foo', |
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.
@pelotom This was accepted before I added the asterisk
to the InputLabelClassKey
. Hovering over the classes
prop did show Partial<Record<InputLabelClassKey, string>>
which should reject that. Writing
const classes: Partial<Record<InputLabelClassKey, string>> = { asterisk: 'foo' }
did however throw an error.
I suspect this is a typescript bug?
@@ -34,6 +34,7 @@ export const styles = theme => ({ | |||
filled: {}, | |||
/* Styles applied to the root element if `required={true}`. */ | |||
required: {}, | |||
/* Styles applied to the asterisk element if `required={true}`. */ |
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.
/* Styles applied to the asterisk element if `required={true}`. */ | |
/* Styles applied to the asterisk element. */ |
(required
just controls whether the asterisk is displayed, not whether it receives this style.)
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.
Thanks for reviewing. I have added requested changes.
@umairfarooq44 It's a great first pull request on Material-UI 👌🏻. Thank you for working on it! |
Fixes #14490
Breaking change
You should be able to override all the styles of the FormLabel component using the css API of the InputLabel component. We do no longer need the
FormLabelClasses
property.