-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[ListItemText] Fix primary={0} display #11686
Conversation
Writing tests like the following fails: assert.strictEqual(
wrapper
.childAt(0)
.children()
.equals(0),
true,
'should have 0 as primary text',
); Any idea why? |
const hasPrimary = primaryProp || primaryProp === 0; | ||
let primary = hasPrimary ? primaryProp : children; | ||
|
||
if (hasPrimary && !disableTypography) { |
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.
Since hasPrimary
is only true for primaryProp
, this presumably won't work for children
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.
Agreed.
I'm still confused why #11686 (comment) fails. Otherwise, the recent commit looks good to me! |
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.
LGTM!
* Display 0's with ListItemText * 🌹
Closes #11672.