if(grandParent && grandParent.children().length === 1) {
goto = grandParent.append({text: ''});
} else {
- goto = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]', direction, element.dom()[0]));
+ goto = element.getNearestTextElement(direction);
}
parent.detach();
} else {
- goto = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]', direction, element.dom()[0]));
+ goto = element.getNearestTextElement(direction);
element.detach();
}
canvas.setCurrentElement(goto, {caretTo: caretTo});