Fix
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 14 Aug 2013 07:33:46 +0000 (09:33 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 14 Aug 2013 07:33:46 +0000 (09:33 +0200)
modules/documentCanvas/canvas/keyboard.js

index d851e3e..3ce1871 100644 (file)
@@ -173,11 +173,11 @@ handlers.push({keys: [KEYS.BACKSPACE, KEYS.DELETE],
                 if(grandParent && grandParent.children().length === 1) {
                     goto = grandParent.append({text: ''});
                 } else {
-                    goto = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]', direction, element.dom()[0]));
+                    goto = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]:visible', direction, element.dom()[0]));
                 }
                 parent.detach();
             } else {
-                goto = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]', direction, element.dom()[0]));
+                goto = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]:visible', direction, element.dom()[0]));
                 element.detach();
             }
             canvas.setCurrentElement(goto, {caretTo: caretTo});