Bug 1224115 - Fix keyboard navigation for filtered TableWidget. r=mratcliffe
authorTim Nguyen <ntim.bugs@gmail.com>
Tue, 01 Mar 2016 16:57:48 +0100
changeset 322565 3e7920e7ba9bbe93f2e89cf051452d6953b31514
parent 322564 355c766e71ddb4fc332db9cbb61a0c400c0581a5
child 322566 b8ef51241262420f7894536e92464e351c14ed66
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmratcliffe
bugs1224115
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1224115 - Fix keyboard navigation for filtered TableWidget. r=mratcliffe MozReview-Commit-ID: C5nwTOZgHGu
devtools/client/shared/widgets/TableWidget.js
--- a/devtools/client/shared/widgets/TableWidget.js
+++ b/devtools/client/shared/widgets/TableWidget.js
@@ -959,23 +959,33 @@ Column.prototype = {
       case event.DOM_VK_END:
         return;
       case event.DOM_VK_UP:
         event.preventDefault();
         let prevRow = event.originalTarget.previousSibling;
         if (this.header == prevRow) {
           prevRow = this.column.lastChild;
         }
+        while (prevRow.hasAttribute("hidden")) {
+          prevRow = prevRow.previousSibling;
+          if (this.header == prevRow) {
+            prevRow = this.column.lastChild;
+          }
+        }
         this.table.emit(EVENTS.ROW_SELECTED, prevRow.getAttribute("data-id"));
         break;
 
       case event.DOM_VK_DOWN:
         event.preventDefault();
         let nextRow = event.originalTarget.nextSibling ||
                       this.header.nextSibling;
+        while (nextRow.hasAttribute("hidden")) {
+          nextRow = nextRow.nextSibling ||
+                    this.header.nextSibling;
+        }
         this.table.emit(EVENTS.ROW_SELECTED, nextRow.getAttribute("data-id"));
         break;
     }
   }
 };
 
 /**
  * A single cell in a column