Skip to content

Commit

Permalink
fix(select): inherit width of the host
Browse files Browse the repository at this point in the history
related: #4312

This PR makes select inherit it's min. max, and normal width from host. It also makes list item make the headline not wrap. The effect this has is that the width of the menu in select will match that of the select input, but if the contents of the menu are wider than the width of the select, then the menu will be wider than the select input.

PiperOrigin-RevId: 535695646
  • Loading branch information
Elliott Marquez authored and copybara-github committed May 26, 2023
1 parent 33daf19 commit 086565c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion list/lib/_list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
}

color: unset;
min-width: 300px;
}

.md3-list {
Expand Down
3 changes: 3 additions & 0 deletions list/lib/listitem/_list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@

.label-text {
display: flex;
text-overflow: ellipsis;
overflow-x: hidden;
white-space: nowrap;
color: var(--_list-item-label-text-color);
font: var(--_list-item-label-text-type);

Expand Down
9 changes: 8 additions & 1 deletion select/lib/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@
position: relative;
}

.field,
.select,
md-menu {
min-width: 100%;
max-width: inherit;
}

.field,
.select {
min-width: inherit;
width: 100%;
}

:host {
Expand Down

0 comments on commit 086565c

Please sign in to comment.