I am facing an issue where the cardTitle
is overlapping the Card
when the text is too long. Currently, I am manually setting a static maxWidth
, but I would prefer for it to adjust based on the size of the Card
. Is there a way to achieve this dynamically?
<Stack
sx={{
maxWidth: "330px"
}}
>
<Tooltip
title={<Typography variant="body1">{cardTitle}</Typography>}
>
<Typography
variant="h3"
sx={{
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
width: "100%"
}}
>
{cardTitle}
</Typography>
</Tooltip>
</Stack>