@@ -19,7 +19,6 @@ $mat-select-trigger-font-size: 16px !default;
1919
2020.mat-select-trigger {
2121 display : flex ;
22- justify-content : space-between ;
2322 align-items : center ;
2423 height : $mat-select-trigger-height ;
2524 min-width : $mat-select-trigger-min-width ;
@@ -29,18 +28,30 @@ $mat-select-trigger-font-size: 16px !default;
2928 font-size : $mat-select-trigger-font-size ;
3029
3130 [aria-disabled = ' true' ] & {
32- @include mat-control-disabled-underline ();
33- border-bottom : transparent ;
34- background-position : 0 bottom ;
3531 cursor : default ;
3632 user-select : none ;
3733 }
3834}
3935
36+ .mat-select-underline {
37+ position : absolute ;
38+ bottom : 0 ;
39+ left : 0 ;
40+ right : 0 ;
41+ height : 1px ;
42+
43+ [aria-disabled = ' true' ] & {
44+ @include mat-control-disabled-underline ();
45+ background-color : transparent ;
46+ background-position : 0 bottom ;
47+ }
48+ }
49+
4050.mat-select-placeholder {
4151 position : relative ;
4252 padding : 0 2px ;
4353 transform-origin : left top ;
54+ flex-grow : 1 ;
4455
4556 // These values are duplicated from animation code in order to
4657 // allow placeholders to sometimes float without animating,
@@ -69,29 +80,36 @@ $mat-select-trigger-font-size: 16px !default;
6980}
7081
7182.mat-select-value {
72- @include mat-truncate-line ();
7383 position : absolute ;
74- max-width : calc (100% - #{$mat-select-arrow-size * 2 } );
84+ max-width : calc (100% - #{($mat-select-arrow-size + $mat-select-arrow-margin ) * 2 } );
85+ flex-grow : 1 ;
7586
7687 // Firefox and some versions of IE incorrectly keep absolutely
7788 // positioned children of flex containers in the flex flow when calculating
7889 // position. This has been fixed for Firefox 52, slated for early 2017.
7990 // Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=874718
8091 //
81- // In the meantime, we must adjust the left position to 0 to mimic where it
82- // would be if it were correctly taken out of the flex flow. It's also necessary
83- // to adjust the top value because absolutely positioned elements should not be
84- // affected by the flex container's "align-items" property either. To center the text,
85- // we must offset by 6px (6px top + 6px bottom + 18px text height = 30px total height).
92+ // In the meantime, we must adjust the position to fit the top, left, and bottom edge of the
93+ // containing trigger element. In doing so, we can use align-items: center to allow the text to
94+ // correctly position itself in the middle of the container.
95+ top : 0 ;
8696 left : 0 ;
87- top : 6px ;
97+ bottom : 0 ;
98+
99+ display : flex ;
100+ align-items : center ;
88101
89102 [dir = ' rtl' ] & {
90103 left : auto ;
91104 right : 0 ;
92105 }
93106}
94107
108+ .mat-select-value-text {
109+ @include mat-truncate-line ();
110+ line-height : $mat-select-trigger-height ;
111+ }
112+
95113.mat-select-arrow {
96114 width : 0 ;
97115 height : 0 ;
0 commit comments