Skip to content

Commit 712d1d4

Browse files
bmeurerDevtools-frontend LUCI CQ
authored andcommitted
[settings] Don't show borders for empty lists.
Drive-by-fix: Also fix an error that is thrown when the last item in a list is removed. Fixed: 378853303 Change-Id: I237bcb45dd2880bd0860ec76b49ae266951b5280 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6017890 Auto-Submit: Benedikt Meurer <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Reviewed-by: Kateryna Prokopenko <[email protected]>
1 parent ac4ee80 commit 712d1d4

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export class ThrottlingSettingsTab extends UI.Widget.VBox implements
133133

134134
const settingsContent =
135135
this.contentElement.createChild('div', 'settings-card-container-wrapper').createChild('div');
136-
settingsContent.classList.add('settings-card-container', 'ignore-list-settings');
136+
settingsContent.classList.add('settings-card-container', 'throttling-conditions-settings');
137137

138138
const addButton = new Buttons.Button.Button();
139139
addButton.classList.add('add-conditions-button');

front_end/ui/legacy/ListWidget.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ export class ListWidget<T> extends VBox {
199199
this.element.focus();
200200
this.delegate.removeItemRequested(this.items[index], index);
201201
ARIAUtils.alert(i18nString(UIStrings.removedItem));
202-
// focus on the next item in the list, or the last item if we're removing the last item
203-
(this.elements[Math.min(index, this.elements.length - 1)] as HTMLElement).focus();
202+
if (this.elements.length >= 1) {
203+
// focus on the next item in the list, or the last item if we're removing the last item
204+
(this.elements[Math.min(index, this.elements.length - 1)] as HTMLElement).focus();
205+
}
204206
}
205207
}
206208

front_end/ui/legacy/listWidget.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
.list {
88
flex: auto 0 1;
99
overflow-y: auto;
10-
border: 1px solid var(--sys-color-divider);
1110
flex-direction: column;
1211

1312
--override-background-list-item-color: hsl(0deg 0% 96%);
13+
14+
&:has(div) {
15+
border: var(--sys-size-1) solid var(--sys-color-divider);
16+
}
1417
}
1518

1619
.theme-with-dark-background .list,

0 commit comments

Comments
 (0)