Skip to content

Commit 3c2e7f1

Browse files
authored
HParams: Prevent select allheckbox from its default behavior (#6478)
## Motivation for features / changes The select all checkbox very often got into a bad state where it showed checked when it should show unchecked and vice versa. This fixes that bug. I could not get the tests to reproduce the issue so I could not write a test to ensure it does not happen again. ## Technical description of changes I could not completely nail down why this was happening. This does fix it though. ## Screenshots of UI changes (or N/A) Before: <img width="50" alt="Screenshot 2023-06-30 at 2 33 35 PM" src="https://github.com/tensorflow/tensorboard/assets/8672809/dd394644-2760-4e0a-881f-07c360d33ed6"> <img width="51" alt="Screenshot 2023-06-30 at 2 33 27 PM" src="https://github.com/tensorflow/tensorboard/assets/8672809/c0664111-4a1a-4f5d-aa38-acc35681a108"> After: <img width="66" alt="Screenshot 2023-06-30 at 2 21 03 PM" src="https://github.com/tensorflow/tensorboard/assets/8672809/26544174-7aac-45a4-95a1-6b2a1de3a756"> <img width="56" alt="Screenshot 2023-06-30 at 2 20 56 PM" src="https://github.com/tensorflow/tensorboard/assets/8672809/4f2733d6-eb02-430f-8db9-71d22d54a8d4">
1 parent 54129b3 commit 3c2e7f1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

tensorboard/webapp/runs/views/runs_table/runs_data_table.ng.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<mat-checkbox
4747
[checked]="allRowsSelected()"
4848
[indeterminate]="!allRowsSelected() && someRowsSelected()"
49-
(click)="onAllSelectionToggle.emit(getRunIds())"
49+
(click)="handleSelectAll($event)"
5050
></mat-checkbox>
5151
</div>
5252
<span class="group-menu-container" *ngSwitchCase="'color'">

tensorboard/webapp/runs/views/runs_table/runs_data_table.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ export class RunsDataTable {
8888
);
8989
}
9090

91-
getRunIds() {
92-
return this.data.map((row) => row.id);
93-
}
94-
9591
allRowsSelected() {
9692
return this.data.every((row) => row['selected']);
9793
}
@@ -100,6 +96,11 @@ export class RunsDataTable {
10096
return this.data.some((row) => row['selected']);
10197
}
10298

99+
handleSelectAll(event: MouseEvent) {
100+
event.preventDefault();
101+
this.onAllSelectionToggle.emit(this.data.map((row) => row.id));
102+
}
103+
103104
onFilterKeyUp(event: KeyboardEvent) {
104105
const input = event.target! as HTMLInputElement;
105106
this.onRegexFilterChange.emit(input.value);

0 commit comments

Comments
 (0)