From 086565cc8c0e6463a6be60162a22014955b23adb Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Fri, 26 May 2023 13:08:39 -0700 Subject: [PATCH] fix(select): inherit width of the host 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 --- list/lib/_list.scss | 1 - list/lib/listitem/_list-item.scss | 3 +++ select/lib/_shared.scss | 9 ++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/list/lib/_list.scss b/list/lib/_list.scss index e74c88d251..5304c0b37b 100644 --- a/list/lib/_list.scss +++ b/list/lib/_list.scss @@ -36,7 +36,6 @@ } color: unset; - min-width: 300px; } .md3-list { diff --git a/list/lib/listitem/_list-item.scss b/list/lib/listitem/_list-item.scss index 94ccb002fb..0a8ad3ff8f 100644 --- a/list/lib/listitem/_list-item.scss +++ b/list/lib/listitem/_list-item.scss @@ -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); diff --git a/select/lib/_shared.scss b/select/lib/_shared.scss index 0372ed6105..25e4fa84a7 100644 --- a/select/lib/_shared.scss +++ b/select/lib/_shared.scss @@ -29,9 +29,16 @@ position: relative; } + .field, + .select, + md-menu { + min-width: 100%; + max-width: inherit; + } + .field, .select { - min-width: inherit; + width: 100%; } :host {