diff --git a/editor/base/nsHTMLEditor.cpp b/editor/base/nsHTMLEditor.cpp
index 36202cae49e5..2c7dd712f6fb 100644
--- a/editor/base/nsHTMLEditor.cpp
+++ b/editor/base/nsHTMLEditor.cpp
@@ -1801,6 +1801,7 @@ nsHTMLEditor::InsertElementAtSelection(nsIDOMElement* aElement, PRBool aDeleteSe
nsCOMPtr brNode;
res = CreateBR(parentSelectedNode, offsetForInsert+1, address_of(brNode));
if (NS_FAILED(res)) return res;
+ selection->Collapse(parentSelectedNode, offsetForInsert+1);
}
}
}
diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp
index 36202cae49e5..2c7dd712f6fb 100644
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -1801,6 +1801,7 @@ nsHTMLEditor::InsertElementAtSelection(nsIDOMElement* aElement, PRBool aDeleteSe
nsCOMPtr brNode;
res = CreateBR(parentSelectedNode, offsetForInsert+1, address_of(brNode));
if (NS_FAILED(res)) return res;
+ selection->Collapse(parentSelectedNode, offsetForInsert+1);
}
}
}