-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
[Joy] Fix list value of false or 0 (zero) text is incorrectly grey #34255
[Joy] Fix list value of false or 0 (zero) text is incorrectly grey #34255
Conversation
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 should work in almost every scenario, but if ownerState.value happens to be an object with properties, those properties will be merged with the styles object and potentially overwrite something or even accidentally add a style, or it might trigger a warning or error elsewhere if the style object is validated because it contains invalid properties. It is very unlikely but possible. I would suggest something like: (ownerState.value === null || ownerState.value === undefined) && {
opacity: 'var(--Select-placeholderOpacity)',
}
@neovirtual
|
@kushagra010 It appears we are in agreement about applying the placeholderOpacity style based on checking for null or undefined value as opposed to using the javascript nullish coalescing operator (??). If the current value given to the Select component is 0 (zero) or false, it should highlight the corresponding list item. I have not checked whether that is working as expected and it was not the reason I opened this bug report, but nonetheless it is an important matter to look into. Thank you. |
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 your first contribution!
I'd love to hear your feedback about Joy UI. What do you like and what should be improved? let me know!
Fixes #34210
After fix: https://codesandbox.io/s/joy-issue-34210-select-component-qdwi3h?file=/demo.js