-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
[Rating] Add TODO comment in Rating component to use readOnly
state class
#36357
[Rating] Add TODO comment in Rating component to use readOnly
state class
#36357
Conversation
readOnly
in state class listreadOnly
in state class list
readOnly
in state class listreadOnly
in state class list
readOnly
in state class listreadOnly
in state class list
Netlify deploy previewhttps://deploy-preview-36357--material-ui.netlify.app/ Bundle size report |
readOnly
in state class listreadOnly
in state class list
readOnly
in state class listreadOnly
in state class list to trigger warning
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.
The changes makes sense, however in this moment the Rating component does not increases the specificity for the readOnly
state. We could introduce this breaking changes in the next major release. The error currently is kind of not reflecting the correct state of things, which may be confusing. Let's add in https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Rating/Rating.js#L106 comment for using the state class in v6.
readOnly
in state class list to trigger warningreadOnly
state class
readOnly
state class readOnly
state class
Oh okay. I didn't notice that the I wonder whether it is better to use |
This is always the recommended approach, except for the state classes, so that we are closer to the CSS pseudo selectors. For e.g. in plain CSS you would have: |
With the advent of
readOnly
global state class in #32822, we also need to add it in the list of state classes that is used to trigger the CSS specificity warning when overriding in theme. We missed it in #32822.I refactored it to keep it defined in one place only. Otherwise, this would be easy to miss in future.