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:
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:
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.
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.
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.