Skip to content

Commit

Permalink
ui: increase width and allow long dropdown items to wrap (#5194)
Browse files Browse the repository at this point in the history
The 'tb-dropdown' widget now better handles items that are very
long. The dropdown menu width grows to fit content, up to a point,
and longer text will wrap.

Googlers, see b/193896469, and cl/388827477 for more.
  • Loading branch information
psybuzz authored Aug 5, 2021
1 parent b9b5b9d commit 21e09a8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tensorboard/webapp/widgets/dropdown/dropdown_component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,17 @@ mat-select:focus {
outline-color: -webkit-focus-ring-color;
outline-style: auto;
}

::ng-deep .mat-select-panel {
max-width: 70vw;
}

.tb-mat-option {
// Overrides Angular Material's fixed height.
height: auto;
}

::ng-deep .mat-option-text {
white-space: normal;
word-break: break-all;
}
1 change: 1 addition & 0 deletions tensorboard/webapp/widgets/dropdown/dropdown_component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export interface DropdownOption {
>
<mat-option
*ngFor="let option of options"
class="tb-mat-option"
[value]="option.value"
[disabled]="option.disabled"
>
Expand Down

0 comments on commit 21e09a8

Please sign in to comment.