I have a problem with MuiCardHeader
<CardHeader
disableTypography
avatar={renderAvatar()}
action={
<IconButton onClick={toggleMenu}>
<img src={MoreIcon} alt=""/>
</IconButton>
}
title={
<Typography noWrap variant="subtitle1">
{data.name}
</Typography>
}
subheader={
<Typography variant="subtitle2" color="textSecondary">
{data.children.items.length} items
</Typography>
}
/>
For some reason too long title or subtitle slide the menu button to the right outside the card.
How can I prevent it?
Result I need
Here is code sandbox
https://codesandbox.io/s/dazzling-paper-5d35h?file=/src/App.js
UPD: Solution
Add the following code
textOverflow: "ellipsis",
overflow: "hidden",
whiteSpace: "nowrap",
to .MuiCardHeader-content
class
Thanks to everyone for help!