From 4aeab46723e464d604ced64f9bddb8fa0921df5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Fri, 8 Aug 2014 11:31:15 +0200 Subject: [PATCH] editor: canvas - block merging at the boundries of a context root --- src/editor/modules/documentCanvas/canvas/keyboard.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/editor/modules/documentCanvas/canvas/keyboard.js b/src/editor/modules/documentCanvas/canvas/keyboard.js index d8052ed..e43ea89 100644 --- a/src/editor/modules/documentCanvas/canvas/keyboard.js +++ b/src/editor/modules/documentCanvas/canvas/keyboard.js @@ -257,6 +257,14 @@ var keyEventHandlers = [ 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 + // - this is a temporary solution until key events handling get refactored into something more sane. + return; + } + e.preventDefault(); s.canvas.wlxmlDocument.transaction(function() { -- 2.20.1