summaryrefslogtreecommitdiffstats
path: root/devtools/client/shared
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-28 12:23:00 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-28 12:23:00 +0200
commit2d7d421391404f3bc86e4dda4eb6be93087bf2f6 (patch)
treeb28201e52138c8065c57df0cc9c891f9d95b8a13 /devtools/client/shared
parentc75dae3ed21bfa5a8ae46cd83d18329af5bea05a (diff)
downloadUXP-2d7d421391404f3bc86e4dda4eb6be93087bf2f6.tar
UXP-2d7d421391404f3bc86e4dda4eb6be93087bf2f6.tar.gz
UXP-2d7d421391404f3bc86e4dda4eb6be93087bf2f6.tar.lz
UXP-2d7d421391404f3bc86e4dda4eb6be93087bf2f6.tar.xz
UXP-2d7d421391404f3bc86e4dda4eb6be93087bf2f6.zip
[DevTools] Storage inspector throws an error when use arrow keys
Issue #102
Diffstat (limited to 'devtools/client/shared')
-rw-r--r--devtools/client/shared/widgets/TableWidget.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/devtools/client/shared/widgets/TableWidget.js b/devtools/client/shared/widgets/TableWidget.js
index a0f0dfc11..57d2914d5 100644
--- a/devtools/client/shared/widgets/TableWidget.js
+++ b/devtools/client/shared/widgets/TableWidget.js
@@ -463,7 +463,14 @@ TableWidget.prototype = {
return;
}
- let selectedCell = this.tbody.querySelector(".theme-selected");
+ // We need to get the first *visible* selected cell. Some columns are hidden
+ // e.g. because they contain a unique compound key for cookies that is never
+ // displayed in the UI. To do this we get all selected cells and filter out
+ // any that are hidden.
+ let selectedCells = [...this.tbody.querySelectorAll(".theme-selected")]
+ .filter(cell => cell.clientWidth > 0);
+ // Select the first visible selected cell.
+ let selectedCell = selectedCells[0];
if (!selectedCell) {
return;
}