From: Jan Szejko Date: Tue, 14 Mar 2017 14:30:25 +0000 (+0100) Subject: fix weird selection after delete X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/18d3b92 fix weird selection after delete --- diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index 99201bc..924a880 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -342,6 +342,10 @@ var keyEventHandlers = [ }, { success: function() { if(goto) { + if(!doc.containsNode(goto.wlxmlNode)) { + goto = s.startElement; + caretTo = s.startOffset; + } s.canvas.setCurrentElement(goto, {caretTo: caretTo}); } }