X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/b95e2e87d96a747f503990f6f315ade26fe88acc..00c7fb9e5f0a51e841d754cc2707b65db9c2737e:/src/editor/modules/documentCanvas/canvas/keyboard.js?ds=sidebyside diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index e7f5fe8..16f2f68 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -189,14 +189,14 @@ handlers.push({keys: [KEYS.BACKSPACE, KEYS.DELETE], goto; if(parent.children().length === 1 && parent.children()[0].sameNode(element)) { if(grandParent && grandParent.children().length === 1) { - goto = grandParent.append({text: ''}); + goto = grandParent.data('wlxmlNode').append({text: ''}); } else { goto = element.getNearestTextElement(direction); } - parent.detach(); + parent.data('wlxmlNode').detach(); } else { goto = element.getNearestTextElement(direction); - element.detach(); + element.data('wlxmlNode').detach(); } canvas.setCurrentElement(goto, {caretTo: caretTo}); canvas.publisher('contentChanged');