X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b1de2ef622519ea790e89bc690f2c4d84e93adec..2d37cb23154783cc89f2ff286405d02e594e0e46:/modules/documentCanvas/canvas/keyboard.js?ds=sidebyside diff --git a/modules/documentCanvas/canvas/keyboard.js b/modules/documentCanvas/canvas/keyboard.js index 3ce1871..1830017 100644 --- a/modules/documentCanvas/canvas/keyboard.js +++ b/modules/documentCanvas/canvas/keyboard.js @@ -173,11 +173,11 @@ handlers.push({keys: [KEYS.BACKSPACE, KEYS.DELETE], if(grandParent && grandParent.children().length === 1) { goto = grandParent.append({text: ''}); } else { - goto = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]:visible', direction, element.dom()[0])); + goto = element.getNearestTextElement(direction); } parent.detach(); } else { - goto = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]:visible', direction, element.dom()[0])); + goto = element.getNearestTextElement(direction); element.detach(); } canvas.setCurrentElement(goto, {caretTo: caretTo});