1

This behaviour is observed in Chrome. When we have a block element with no text and contentEditable set to false, browser is not able to select the text content.

Whereas the same code snippet works correctly in Firefox

So is this a bug in Chrome or expected behaviour ?

 <div id="contentsContainer" contenteditable="true" >
  <div id="contents">
    <div id="section">
      <div>
          <div>
            <div contenteditable="false" id="imgContainer" style="display:block;">
              <span contenteditable="false"></span>
            </div>
          </div>
      </div>
      <div>
        <p>
          <span>
            Some text
          </span>
        </p>
      </div>
    </div>
  </div>

Find JsFiddle here

vin
  • 960
  • 2
  • 14
  • 28
  • 1
    Do you have a question? – Jacob Nov 25 '15 at 09:22
  • I want to understand whether this is a bug in chrome or is this the expected behaviour – vin Nov 25 '15 at 09:26
  • Does [this question](http://stackoverflow.com/questions/4251227/contenteditable-div-not-actually-editable-in-webkit) help? – Jacob Nov 25 '15 at 09:40
  • actually no, the question you pointed to talks of user-select cascaded to 'none'. How ever in my case I am able to set the cursor in contentEditable areas. However the behaviour of 'selectAll' is ambiguous, when we have block elements and inline elements – vin Nov 25 '15 at 09:46

0 Answers0