Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit faa8b5b

Browse files
author
Robert Messerle
committed
fix(input): ngMessages will no longer cause layout to change on
animation
1 parent ee98b70 commit faa8b5b

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/components/input/input.scss

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ md-input-container {
180180
position: relative;
181181
order: 4;
182182
min-height: $input-error-height;
183+
overflow: hidden;
183184

184185
.md-char-counter {
185186
position: absolute;
@@ -216,24 +217,20 @@ md-input-container {
216217

217218
// Since we're delaying the transition, we speed up the duration a little bit to compensate
218219
transition-duration: $swift-ease-in-duration / 1.5;
220+
opacity: 0;
221+
margin-top: -$input-error-line-height - $error-padding-top;
222+
&.ng-enter-active {
223+
opacity: 1;
224+
margin-top: 0;
225+
}
219226
}
220227
&.ng-leave {
221228
transition: $swift-ease-out;
222-
223-
// Speed up the duration (see enter comment above)
224229
transition-duration: $swift-ease-out-duration / 1.5;
225-
}
226-
&.ng-enter,
227-
&.ng-leave.ng-leave-active {
228-
// Move the error upwards off the screen and fade it out
229-
margin-top: -$input-error-line-height - $error-padding-top;
230-
opacity: 0;
231-
}
232-
&.ng-leave,
233-
&.ng-enter.ng-enter-active {
234-
// Move the error down into position and fade it in
235-
margin-top: 0;
236-
opacity: 1;
230+
&.ng-leave-active {
231+
margin-top: -$input-error-line-height - $error-padding-top;
232+
opacity: 0;
233+
}
237234
}
238235
}
239236

0 commit comments

Comments
 (0)