X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/e4833347b89be4ad9534ecd3f836f0606326ee81..refs/heads/master:/src/editor/modules/documentCanvas/canvas/keyboard.js diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index 147ca58..924a880 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -247,11 +247,12 @@ var keyEventHandlers = [ element = s.canvas.getNearestTextElement('below', s.element); } + e.preventDefault(); + if(!element) { return; } - var parent = element.wlxmlNode.parent(); if(element.wlxmlNode.getIndex() === 0 && parent.isContextRoot() && (!parent.is('item') || parent.getIndex() === 0)) { // Don't even try to do anything at the edge of a context root, except for non-first items @@ -259,8 +260,6 @@ var keyEventHandlers = [ return; } - e.preventDefault(); - s.canvas.wlxmlDocument.transaction(function() { if(element.wlxmlNode.getIndex() === 0) { goto = element.wlxmlNode.parent().moveUp();