-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[CircularProgress] String format for size prop not documented #17039
Comments
I checked out the CircularProgress. You're right, the implementation only accounts for number sizes. |
In my personal opinion, it's fine to not append a "px" to a string. |
It also seems e.g. |
Yes, if its a string it'll use that as it is. React uses CSS-in-JS pattern for its inline styling. |
I was thinking we should convert the string to a number; but since it seems it accepts a string with units, we should document that instead, otherwise it would be a breaking change. |
Agree, so something like this? diff --git a/packages/material-ui/src/CircularProgress/CircularProgress.js b/packages/material-ui/src/CircularProgress/CircularProgress.js
index 143174a8b..29b0f49e9 100644
--- a/packages/material-ui/src/CircularProgress/CircularProgress.js
+++ b/packages/material-ui/src/CircularProgress/CircularProgress.js
@@ -196,6 +196,7 @@ CircularProgress.propTypes = {
}),
/**
* The size of the circle.
+ * If using a string, you need to provide the CSS unit, e.g '3rem'.
*/
size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
/** |
There seems to be an error in the CircularProgress docs. The
size
prop says it can be a number or a string. But setting a string value seems to have no effect on the size. Only a number works.The text was updated successfully, but these errors were encountered: