Skip to content

Commit 7c05584

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
Network: fix data-grid being focusable behind the empty state
[email protected] Fixed: 409963787 Change-Id: I2fbabec1c6e1942b46fea22f67ef1c1c020591fd Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6448979 Auto-Submit: Jack Franklin <[email protected]> Reviewed-by: Andres Olivares <[email protected]> Commit-Queue: Jack Franklin <[email protected]> Commit-Queue: Andres Olivares <[email protected]>
1 parent 9f4fd2c commit 7c05584

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

front_end/panels/network/NetworkLogView.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,7 @@ export class NetworkLogView extends Common.ObjectWrapper.eventMixin<EventTypes,
11371137

11381138
private setHidden(value: boolean): void {
11391139
this.columnsInternal.setHidden(value);
1140+
this.dataGrid.setInert(value);
11401141
UI.ARIAUtils.setHidden(this.summaryToolbarInternal, value);
11411142
}
11421143

front_end/ui/legacy/components/data_grid/DataGrid.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,6 +1308,20 @@ export class DataGridImpl<T> extends Common.ObjectWrapper.ObjectWrapper<EventTyp
13081308
return (cellElement && nodeToColumnIdMap.get(cellElement)) || null;
13091309
}
13101310

1311+
/**
1312+
* Mark the data-grid as inert, meaning that it will not capture any user interactions.
1313+
* Useful in some panels where the empty state is actually an absolutely
1314+
* positioned div put over the panel, and in that case we need to ensure the
1315+
* hidden, empty data grid, does not capture any user interaction - in particular if they tab through the UI.
1316+
*/
1317+
setInert(isInert: boolean): void {
1318+
if (isInert) {
1319+
this.element.setAttribute('inert', 'inert');
1320+
} else {
1321+
this.element.removeAttribute('inert');
1322+
}
1323+
}
1324+
13111325
private clickInHeaderCell(event: Event): void {
13121326
const cell = UI.UIUtils.enclosingNodeOrSelfWithNodeName((event.target as Node), 'th');
13131327
if (!cell) {

0 commit comments

Comments
 (0)