@@ -45,8 +45,24 @@ $date-range-input-part-max-width: calc(50% - #{$date-range-input-separator-spaci
45
45
transition : none ;
46
46
}
47
47
48
+ // Wrapper around the inner inputs. Used to facilitate the auto-resizing input.
49
+ .mat-date-range-input-wrapper {
50
+ position : relative ;
51
+ overflow : hidden ;
52
+ max-width : $date-range-input-part-max-width ;
53
+ }
54
+
55
+ .mat-date-range-input-end-wrapper {
56
+ // Allow the end input to fill the rest of the available space.
57
+ flex-grow : 1 ;
58
+ }
59
+
48
60
// Underlying input inside the range input.
49
61
.mat-date-range-input-inner {
62
+ position : absolute ;
63
+ top : 0 ;
64
+ left : 0 ;
65
+
50
66
// Reset the input so it's just a transparent rectangle.
51
67
font : inherit ;
52
68
background : transparent ;
@@ -60,6 +76,10 @@ $date-range-input-part-max-width: calc(50% - #{$date-range-input-separator-spaci
60
76
-webkit-appearance : none ;
61
77
width : 100% ;
62
78
79
+ // Does nothing on Chrome, but necessary for the text
80
+ // to align in some cases on Safari and Firefox.
81
+ height : 100% ;
82
+
63
83
// Undo the red box-shadow glow added by Firefox on invalid inputs.
64
84
// See https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-invalid
65
85
& :-moz-ui-invalid {
@@ -101,7 +121,7 @@ $date-range-input-part-max-width: calc(50% - #{$date-range-input-separator-spaci
101
121
// We want the start input to be flush against the separator, no matter how much text it has, but
102
122
// the problem is that inputs have a fixed width. We work around the issue by implementing an
103
123
// auto-resizing input that stretches based on its text, up to a point. It works by having
104
- // a relatively-positioned wrapper (`.mat-date-range-input-start- wrapper` below) and an absolutely-
124
+ // a relatively-positioned wrapper (`.mat-date-range-input-wrapper` below) and an absolutely-
105
125
// positioned `input`, as well as a `span` inside the wrapper which mirrors the input's value and
106
126
// placeholder. As the user is typing, the value gets mirrored in the span which causes the wrapper
107
127
// to stretch and the input with it.
@@ -122,25 +142,6 @@ $date-range-input-part-max-width: calc(50% - #{$date-range-input-separator-spaci
122
142
min-width : 2px ;
123
143
}
124
144
125
- // Wrapper around the start input. Used to facilitate the auto-resizing input.
126
- .mat-date-range-input-start-wrapper {
127
- position : relative ;
128
- overflow : hidden ;
129
- max-width : $date-range-input-part-max-width ;
130
-
131
- .mat-date-range-input-inner {
132
- position : absolute ;
133
- top : 0 ;
134
- left : 0 ;
135
- }
136
- }
137
-
138
- // Wrapper around the end input that makes sure that it has the proper size.
139
- .mat-date-range-input-end-wrapper {
140
- flex-grow : 1 ;
141
- max-width : $date-range-input-part-max-width ;
142
- }
143
-
144
145
.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix {
145
146
// Bump the default width slightly since it's somewhat cramped with two inputs and a separator.
146
147
width : 200px ;
0 commit comments