title: How to wrap or truncate long strings in a Material-UI ExpansionPanelSummary
body: <p>I want to create an <code>ExpansionPanel</code> where the summary might be a quite long string of unbroken characters (i.e. no hyphens, no spaces).</p>
  
  <p>When I tried it out, the <code>ExpansionPanelSummary</code> component displays poorly on a narrow width display - it overwrites the button and overflows off-screen.</p>
  
  <p>Here is my example, forked from the <a href="https://material-ui.com/demos/expansion-panels/" rel="noreferrer">ExpansionPanel</a> Material-UI demo, shrink the width of the output frame and you can see the email addresses don't wrap and look ugly: <a href="https://codesandbox.io/s/wqm5k3vmyw" rel="noreferrer">https://codesandbox.io/s/wqm5k3vmyw</a>
  <a href="https://i.stack.imgur.com/uQCT6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/uQCT6.png" alt="enter image description here"></a></p>
  
  <p>I've tried using <code>nowrap</code> on the <code>Typography</code> to get it to clip (my preferred solution):</p>
  
  <pre><code>&lt;ExpansionPanelSummary expandIcon={&lt;ExpandMoreIcon /&gt;}&gt;
    &lt;Typography nowrap className={classes.heading}&gt;
      areallyreallylongaddress@email.example.com
    &lt;/Typography&gt;
  &lt;/ExpansionPanelSummary&gt;
  </code></pre>
  
  <p>I've also tried adding a style <code>overflowWrap: "break-word"</code> to force it to wrap anywhere, not just on hyphens or whitespace.</p>
  
  <p>The best I've been able to do is to get the text to not overflow outside the expansion panel itself by adding <code>style={{ textOverflow: "ellipsis", overflow: "hidden" }}</code> to the <code>ExpansionPanel</code> (see the second example from the linked example).  </p>
  
  <p>Ideally, I'd like it to function by truncating from the right of the context, showing an ellipsis and not overwriting the expand icon.<br>
  How can I do that with <code>ExpansionPanel</code>?</p>
  
  <p>Failing that, how can I just force it to word-wrap?</p>
  
  <p>I'm using material-UI v3.4.0 and the problem is visible on Chrome and Firefox.</p>