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/55a7fd3acdadc4777e2680b9bf64f96c509c6dac?hp=949f04475963f4f2ae93f7a2a84ed577420514c6 fix weird selection after delete (cherry picked from commit 18d3b92) --- diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index e43ea89..30754c5 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -349,6 +349,10 @@ var keyEventHandlers = [ }, { success: function() { if(goto) { + if(!doc.containsNode(goto.wlxmlNode)) { + goto = s.startElement; + caretTo = s.startOffset; + } s.canvas.setCurrentElement(goto, {caretTo: caretTo}); } }