Is there a way to create an ExpansionPanel
with a summary that consists of a long string of unbroken characters, without any hyphens or spaces?
When attempting this, the ExpansionPanelSummary
component does not display properly on narrow displays, overlapping the button and extending off-screen.
For instance, in this example based on the Material-UI ExpansionPanel demo, reducing the frame width reveals that email addresses do not wrap nicely: https://codesandbox.io/s/wqm5k3vmyw https://i.sstatic.net/uQCT6.png
Attempts have been made using the nowrap
attribute on Typography
to clip text, but it is not the ideal solution:
<ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
<Typography nowrap className={classes.heading}>
<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="03627166626f6f7a7166626f6f7a6f6c6d646267677166707043666e626a6f2d667b62 [email protected]</a>
</Typography>
</ExpansionPanelSummary>
Additionally, applying a style of overflowWrap: "break-word"
has been tried to force wrapping regardless of hyphens or whitespaces.
The best achieved result so far has been containing the text within the expansion panel by using
style={{ textOverflow: "ellipsis", overflow: "hidden" }}
on the ExpansionPanel
(referencing the second example in the provided link).
Ideally, truncating text from the right, displaying an ellipsis, and preventing overlap with the expand icon would be preferred. How can this be accomplished with ExpansionPanel
?
If not possible, how can word-wrap be enforced instead?
This issue persists with Chrome and Firefox when using material-UI v3.4.0.