File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 88 < div class ="mat-input-infix mat-form-field-infix ">
99 < ng-content > </ ng-content >
1010
11- < span class ="mat-form-field-label-wrapper ">
11+ <!--
12+ TODO: remove `mat-input-placeholder-wrapper` and `mat-form-field-placeholder-wrapper`
13+ next time we do breaking changes.
14+ -->
15+ < span class ="mat-form-field-label-wrapper mat-input-placeholder-wrapper mat-form-field-placeholder-wrapper ">
1216 <!-- We add aria-owns as a workaround for an issue in JAWS & NVDA where the label isn't
1317 read if it comes before the control in the DOM. -->
14- < label class ="mat-form-field-label "
18+
19+ <!--
20+ TODO: remove `mat-input-placeholder` and `mat-form-field-placeholder`
21+ next time we do breaking changes.
22+ -->
23+ < label class ="mat-form-field-label mat-input-placeholder mat-form-field-placeholder "
1524 [attr.for] ="_control.id "
1625 [attr.aria-owns] ="_control.id "
1726 [class.mat-empty] ="_control.empty && !_shouldAlwaysFloat "
Original file line number Diff line number Diff line change 3737 display : none ;
3838 }
3939
40+ @include input-placeholder {
41+ // Delay the transition until the label has animated about a third of the way through, in
42+ // order to prevent the placeholder from overlapping for a split second.
43+ transition : color $swift-ease-out-duration $swift-ease-out-duration / 3
44+ $swift-ease-out-timing-function ;
45+ }
46+
4047 .mat-form-field-hide-placeholder & {
4148 // Note that we can't use something like visibility: hidden or
4249 // display: none, because IE ends up preventing the user from
4552 // Needs to be !important, because the placeholder will end up inheriting the
4653 // input color in IE, if the consumer overrides it with a higher specificity.
4754 color : transparent !important ;
55+
56+ // Remove the transition to prevent the placeholder
57+ // from overlapping when the label comes back down.
58+ transition : none ;
4859 }
4960 }
5061}
Original file line number Diff line number Diff line change @@ -89,7 +89,16 @@ $mat-select-placeholder-arrow-space: 2 * ($mat-select-arrow-size + $mat-select-a
8989}
9090
9191.mat-select-placeholder {
92+ // Delay the transition until the label has animated about a third of the way through, in
93+ // order to prevent the placeholder from overlapping for a split second.
94+ transition : color $swift-ease-out-duration $swift-ease-out-duration / 3
95+ $swift-ease-out-timing-function ;
96+
9297 .mat-form-field-hide-placeholder & {
9398 color : transparent ;
99+
100+ // Remove the transition to prevent the placeholder
101+ // from overlapping when the label comes back down.
102+ transition : none ;
94103 }
95104}
You can’t perform that action at this time.
0 commit comments