4
4
@import ' ../core/style/vendor-prefixes' ;
5
5
@import ' ../core/a11y/a11y' ;
6
6
7
- $mat-select-trigger-height : 30px !default ;
8
7
$mat-select-trigger-min-width : 112px !default ;
9
8
$mat-select-arrow-size : 5px !default ;
10
9
$mat-select-arrow-margin : 4px !default ;
@@ -13,12 +12,17 @@ $mat-select-panel-max-height: 256px !default;
13
12
.mat-select {
14
13
display : inline-block ;
15
14
outline : none ;
15
+
16
+ // Inside of a form field we want it to expand to take the available space.
17
+ .mat-form-field & {
18
+ display : block ;
19
+ width : 100% ;
20
+ }
16
21
}
17
22
18
23
.mat-select-trigger {
19
24
display : flex ;
20
25
align-items : center ;
21
- height : $mat-select-trigger-height ;
22
26
min-width : $mat-select-trigger-min-width ;
23
27
cursor : pointer ;
24
28
position : relative ;
@@ -31,34 +35,14 @@ $mat-select-panel-max-height: 256px !default;
31
35
}
32
36
33
37
.mat-select-value {
34
- position : absolute ;
35
- max-width : calc (100% - #{($mat-select-arrow-size + $mat-select-arrow-margin ) * 2 } );
36
- flex-grow : 1 ;
37
-
38
- // Firefox and some versions of IE incorrectly keep absolutely
39
- // positioned children of flex containers in the flex flow when calculating
40
- // position. This has been fixed for Firefox 52, slated for early 2017.
41
- // Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=874718
42
- //
43
- // In the meantime, we must adjust the position to fit the top, left, and bottom edge of the
44
- // containing trigger element. In doing so, we can use align-items: center to allow the text to
45
- // correctly position itself in the middle of the container.
46
- top : 0 ;
47
- left : 0 ;
48
- bottom : 0 ;
49
-
50
38
display : flex ;
39
+ flex : auto ;
51
40
align-items : center ;
52
-
53
- [dir = ' rtl' ] & {
54
- left : auto ;
55
- right : 0 ;
56
- }
41
+ min-width : 0 ;
57
42
}
58
43
59
44
.mat-select-value-text {
60
45
@include mat-truncate-line ();
61
- line-height : $mat-select-trigger-height ;
62
46
}
63
47
64
48
.mat-select-arrow {
0 commit comments