4
4
$md-select-trigger-height : 30px !default ;
5
5
$md-select-trigger-min-width : 112px !default ;
6
6
$md-select-arrow-size : 5px !default ;
7
+ $md-select-arrow-margin : 4px !default ;
7
8
8
9
md-select {
9
10
display : inline-block ;
@@ -17,6 +18,7 @@ md-select {
17
18
height : $md-select-trigger-height ;
18
19
min-width : $md-select-trigger-min-width ;
19
20
cursor : pointer ;
21
+ position : relative ;
20
22
21
23
[aria-disabled = ' true' ] & {
22
24
@include md-control-disabled-underline ();
@@ -43,6 +45,24 @@ md-select {
43
45
44
46
.md-select-value {
45
47
position : absolute ;
48
+
49
+ // Firefox and some versions of IE incorrectly keep absolutely
50
+ // positioned children of flex containers in the flex flow when calculating
51
+ // position. This has been fixed for Firefox 52, slated for early 2017.
52
+ // Bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=874718
53
+ //
54
+ // In the meantime, we must adjust the left position to 0 to mimic where it
55
+ // would be if it were correctly taken out of the flex flow. It's also necessary
56
+ // to adjust the top value because absolutely positioned elements should not be
57
+ // affected by the flex container's "align-items" property either. To center the text,
58
+ // we must offset by 6px (6px top + 6px bottom + 18px text height = 30px total height).
59
+ left : 0 ;
60
+ top : 6px ;
61
+
62
+ [dir = ' rtl' ] & {
63
+ left : auto ;
64
+ right : 0 ;
65
+ }
46
66
}
47
67
48
68
.md-select-arrow {
@@ -51,6 +71,7 @@ md-select {
51
71
border-left : $md-select-arrow-size solid transparent ;
52
72
border-right : $md-select-arrow-size solid transparent ;
53
73
border-top : $md-select-arrow-size solid ;
74
+ margin : 0 $md-select-arrow-margin ;
54
75
}
55
76
56
77
.md-select-panel {
0 commit comments