@@ -19,7 +19,6 @@ $mat-select-trigger-font-size: 16px !default;
19
19
20
20
.mat-select-trigger {
21
21
display : flex ;
22
- justify-content : space-between ;
23
22
align-items : center ;
24
23
height : $mat-select-trigger-height ;
25
24
min-width : $mat-select-trigger-min-width ;
@@ -29,18 +28,30 @@ $mat-select-trigger-font-size: 16px !default;
29
28
font-size : $mat-select-trigger-font-size ;
30
29
31
30
[aria-disabled = ' true' ] & {
32
- @include mat-control-disabled-underline ();
33
- border-bottom : transparent ;
34
- background-position : 0 bottom ;
35
31
cursor : default ;
36
32
user-select : none ;
37
33
}
38
34
}
39
35
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
+
40
50
.mat-select-placeholder {
41
51
position : relative ;
42
52
padding : 0 2px ;
43
53
transform-origin : left top ;
54
+ flex-grow : 1 ;
44
55
45
56
// These values are duplicated from animation code in order to
46
57
// allow placeholders to sometimes float without animating,
@@ -69,29 +80,36 @@ $mat-select-trigger-font-size: 16px !default;
69
80
}
70
81
71
82
.mat-select-value {
72
- @include mat-truncate-line ();
73
83
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 ;
75
86
76
87
// Firefox and some versions of IE incorrectly keep absolutely
77
88
// positioned children of flex containers in the flex flow when calculating
78
89
// position. This has been fixed for Firefox 52, slated for early 2017.
79
90
// Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=874718
80
91
//
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 ;
86
96
left : 0 ;
87
- top : 6px ;
97
+ bottom : 0 ;
98
+
99
+ display : flex ;
100
+ align-items : center ;
88
101
89
102
[dir = ' rtl' ] & {
90
103
left : auto ;
91
104
right : 0 ;
92
105
}
93
106
}
94
107
108
+ .mat-select-value-text {
109
+ @include mat-truncate-line ();
110
+ line-height : $mat-select-trigger-height ;
111
+ }
112
+
95
113
.mat-select-arrow {
96
114
width : 0 ;
97
115
height : 0 ;
0 commit comments