X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/27d9dcbb6ce470c99607666a16eeaac0aff608a4..7263e5132059abc0e93deac2175db475f90e7617:/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 0ad2ff3..99201bc 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();