Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

Symptoms

When you type text in a contentEditable div that contains a <br> tag in Internet Explorer 11 or Microsoft Edge, the <br> tag is deleted unexpectedly. This behavior occurs in a contentEditable div that hosts content that's separated by a <br> tag. 

For example, assume that you select Line2 in the following sample HTML and then type asdf:
<div contenteditable="true">
<span>
Line1
<br>
Line2
<br>
Line3
<br>
Line4
</span>
</div>
In this situation, not only is Line2 deleted but also the following <br> tag. Therefore, Line3 joins the text that you typed ("asdf") in Line2, as follows:
<div contenteditable="true">
<span>
Line1
<br>
asdfLine3
<br>
Line4
</span>
</div>
Note This issue occurs if one of the following conditions is true:
  • You press Shift+End to select the line where you'll enter the text.
  • You use the mouse pointer to click just before the <br> tag to select the location for entering the text.

↑ Back to the top


Cause

This issue occurs because the selection tracker service adjusts the selection range during text insertion. The service calls the CSelectTracker::AdjustForCaretRequirements routine, and this moves the end markup pointer so that it includes the trailing line break tag. This, in turn, deletes the line break.

↑ Back to the top


Resolution

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.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


References

Learn about the terminology that Microsoft uses to describe software updates.

↑ Back to the top


Keywords: kbqfe, kbsurveynew, kbfix, kbexpertiseadvanced, kb

↑ Back to the top

Article Info
Article ID : 3163201
Revision : 2
Created on : 2/10/2017
Published on : 2/10/2017
Exists online : False
Views : 255