Skip to content

HParams: Make icons buttons in data table header #6594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
>
<ng-content></ng-content>
<tb-data-table-header [header]="header"></tb-data-table-header>
<div *ngIf="header.sortable" class="sorting-icon-container">
<button
mat-icon-button
*ngIf="header.sortable"
class="sorting-icon-container"
(click)="$event.stopPropagation(); headerClickedHandler()"
>
<mat-icon
*ngIf="
sortingInfo.order === SortingOrder.ASCENDING ||
Expand All @@ -44,14 +49,13 @@
"
svgIcon="arrow_downward_24px"
></mat-icon>
</div>
<div
</button>
<button
mat-icon-button
*ngIf="(header.removable || header.sortable) && !disableContextMenu"
class="context-menu-container show-on-hover"
(click)="onContextMenuOpened($event)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I press "space" on this context menu, the context menu is actually opened in the top-left corner of the runs table rather than next to the location of the button.

image

Is there any way to fix this? Maybe take into account the location of the button when opening the context menu?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I noticed this too I added a task to fix it in our task list.

>
<mat-icon
(click)="onContextMenuOpened($event)"
svgIcon="more_vert_24px"
></mat-icon>
</div>
<mat-icon svgIcon="more_vert_24px"></mat-icon>
</button>
</div>
11 changes: 9 additions & 2 deletions tensorboard/webapp/widgets/data_table/header_cell_component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ $_icon_size: 12px;
&:hover {
opacity: 1;
}
&:focus {
opacity: 1;
}
}
}

.sorting-icon-container,
.context-menu-container {
width: $_icon_size;
height: $_icon_size;
width: $_icon_size + 4px;
height: $_icon_size + 4px;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
}

.cell {
Expand All @@ -51,6 +57,7 @@ $_icon_size: 12px;
mat-icon {
height: $_icon_size;
width: $_icon_size;
line-height: 1;
}

.sorting-icon-container {
Expand Down