-
-
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
[system] decomposeColor() has null value when string has whitespace #44504
Comments
decomposeColor('#aa0099 '.trim()) |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @rdougan How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
I was curious to test how #43289 behaves on this. It's wrong too https://codesandbox.io/p/sandbox/divine-forest-k9wrgw?file=%2Fsrc%2FDemo.tsx%3A4%2C1, in its own way 😄. It looks like we can improve the DX here by having a new error in dev mode only that warns when the input is not correct. |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @rdougan How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
Steps:
Current behavior
Alpha value returned by
decomposeColor
isnull
when the color string passed has whitespace before/after value. Due to this,darken
(and probably other functions) returnNaN
when calculating proper values.Expected behavior
Trim whitespace, or give a warning in the console.
Context
No response
Your environment
npx @mui/envinfo
Search keywords: decomposeColor darken NaN
The text was updated successfully, but these errors were encountered: