ContentEditable div loses <br> tag when you type after selected line of text in Internet Explorer 11

When you type text in a contentEditable div that contains <br> HTML tags in Internet Explorer 11 and Microsoft Edge, the <br> tag is removed unexpectedly.

For example: A span located in a contentEditable div hosting content separated by <br> tag will result in not only the text being removed but the <br> tag as well. If you select Line2 and type, the Line2 and the following <br> statement are removed causing Line3 joining the text that was typed (asdf):
<div contenteditable="true">        <span>            Line1            <br>            Line2            <br>            Line3            <br>            Line4        </span>    </div>
<div contenteditable="true">        <span>            Line1            <br>            asdfLine3               <br>            Line4        </span>    </div>
  • The <br> tag between Line2 and Line3 is missing that causes Line3 to join the typed text.
  • This issue occurs only for two conditions: 
    • If text typing occurs after line selection is made with "Shift+End" key combination.
    • If line is selected by using left mouse click up to the location where <br> exist.
This issue occurs because the selection tracker service adjusts the selection range during text insertion. The adjustment is achieved by calling the routine CSelectTracker::AdjustForCaretRequirements. This causes the end markup pointer to move and include the trailing line break. Therefore, it causes the removal of line break.
To fix this issue, install the most recent cumulative security update for Internet Explorer. To do this, go to Microsoft Update. Additionally, see the technical information about the most recent cumulative security update for Internet Explorer.

Note This update was first included in the MS16-063: Security update for Internet Explorer: June 14, 2016.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Learn about the terminology that Microsoft uses to describe software updates.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Article ID: 3163201 - Last Review: 06/14/2016 16:57:00 - Revision: 1.0

Internet Explorer 11

  • kbqfe kbsurveynew kbfix kbexpertiseadvanced KB3163201