From 271d13b207a50aae35454ec3d85cd2b1f37a64bf Mon Sep 17 00:00:00 2001 From: Elliott Marquez Date: Mon, 22 May 2023 18:10:36 -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: 534244900 --- 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 f5b6980812..026ec2db2d 100644 --- a/list/lib/listitem/_list-item.scss +++ b/list/lib/listitem/_list-item.scss @@ -160,6 +160,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..162ffce6b7 100644 --- a/select/lib/_shared.scss +++ b/select/lib/_shared.scss @@ -30,8 +30,15 @@ } .field, - .select { + .select, + md-menu { min-width: inherit; + max-width: inherit; + } + + .field, + .select { + width: 100%; } :host {