title: Truncate contenteditable with extra space
body: <p>I have a simple <code>div</code> with <strong>contentEditable</strong> <code>true</code> attribute and I also apply <code>ellipsis</code> <strong>CSS</strong>.</p>
  
  <p>The behavior of <strong>contentEditable</strong> it's fine when the content is less and not truncated.</p>
  
  <p><a href="https://i.stack.imgur.com/zdhbb.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zdhbb.png" alt="enter image description here"></a></p>
  
  <p>But when you write extra content and content starts truncated it'll show extra whitespace on the right side.</p>
  
  <p><a href="https://i.stack.imgur.com/MGlga.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MGlga.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ATEKz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ATEKz.png" alt="enter image description here"></a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>div {
    border-bottom: 2px solid #ccc;  
    outline: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-bottom: 5px;
    width: 350px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div contentEditable="true"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>