Fixed arrow key handling in empty lists
diff --git a/dev/js/spec/menuSpec.js b/dev/js/spec/menuSpec.js
index d1dcbe9..55ee44b 100644
--- a/dev/js/spec/menuSpec.js
+++ b/dev/js/spec/menuSpec.js
@@ -787,6 +787,25 @@
       expect(menu._prefix.active()).toBe(true);
     });
 
+    it('should ignore navigation with failing prefix', function () {
+      var menu = KorAP.HintMenu.create("cnx/", list);
+      menu.limit(2);
+      expect(menu.show()).toBe(true);
+
+      menu.next();
+
+      expect(menu.prefix("exit").show()).toBe(true);
+      expect(menu.element().querySelector('li')).toBe(null);
+      expect(menu.shownItem(0)).toBeUndefined();
+      expect(menu._prefix.active()).toBe(true);
+
+      menu.next();
+      expect(menu._prefix.active()).toBe(true);
+
+      menu.prev();
+      expect(menu._prefix.active()).toBe(true);
+
+    });
 
     it('should be navigatable with prefix', function () {
       var menu = KorAP.HintMenu.create("cnx/", demolist);
diff --git a/dev/js/src/menu.js b/dev/js/src/menu.js
index ed6b6c4..b2c541e 100644
--- a/dev/js/src/menu.js
+++ b/dev/js/src/menu.js
@@ -7,7 +7,6 @@
  * TODO: space is not a valid prefix!
  * TODO: Show the slider briefly on move (whenever screen is called).
  * TODO: Optimize scrolling to active item.
- * TODO: Handle arrow keys correctly when list is empty.
  */
 define([
   'menu/item',
@@ -584,6 +583,10 @@
 	};
       };
 
+      // No list
+      if (this.liveLength() === 0)
+	return;
+
       this.position++;
 
       newItem = this.liveItem(this.position);
@@ -628,10 +631,14 @@
 
       // No active element set
       if (this.position === -1) {
-	return;
 	// TODO: Choose last item
+	return;
       };
 
+      // No list
+      if (this.liveLength() === 0)
+	return;
+
       var newItem;
 
       // Set new live item