Skip to content
This repository was archived by the owner on Mar 8, 2019. It is now read-only.

Commit 9ae7dc9

Browse files
committed
Make sure that caret is visible after list insertion (fixes #186)
1 parent 82d3a0e commit 9ae7dc9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/commands/insertOrderedList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ wysihtml5.commands.insertOrderedList = {
3333
// Create list
3434
composer.commands.exec("formatBlock", "div", tempClassName);
3535
tempElement = doc.querySelector("." + tempClassName);
36-
isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE;
36+
isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE || tempElement.innerHTML === "<br>";
3737
composer.selection.executeAndRestoreSimple(function() {
3838
list = wysihtml5.dom.convertToList(tempElement, "ol");
3939
});

src/commands/insertUnorderedList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ wysihtml5.commands.insertUnorderedList = {
3333
// Create list
3434
composer.commands.exec("formatBlock", "div", tempClassName);
3535
tempElement = doc.querySelector("." + tempClassName);
36-
isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE;
36+
isEmpty = tempElement.innerHTML === "" || tempElement.innerHTML === wysihtml5.INVISIBLE_SPACE || tempElement.innerHTML === "<br>";
3737
composer.selection.executeAndRestoreSimple(function() {
3838
list = wysihtml5.dom.convertToList(tempElement, "ul");
3939
});

0 commit comments

Comments
 (0)