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

Commit b7b10bf

Browse files
committed
fix(input): correct initial animation state of messages
With commit cf7f21a, animations were moved to input.js in response to an ng-enter flicker issue with Angular 1.4.x. While the flicker was fixed, new animation bugs arised. Angular 1.4.x added and backported a ng-enter-prepare to avoid this bug. * Use `.ng-enter-prepare` to avoid flicker on Angular 1.4+ * Use `.ng-enter:not(.ng-enter-active)` to prepare animations on 1.3 and below Fixes #6767, #9543, #9723, #10240 Related: angular/angular.js#13408
1 parent 32235b2 commit b7b10bf

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

src/components/input/input-animations.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,4 +345,4 @@ describe('md-input-container animations', function() {
345345

346346
el && el.remove && el.remove();
347347
}
348-
});
348+
});

src/components/input/input.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1077,4 +1077,4 @@ function saveSharedServices(_$$AnimateRunner_, _$animateCss_, _$mdUtil_, _$log_)
10771077
$animateCss = _$animateCss_;
10781078
$mdUtil = _$mdUtil_;
10791079
$log = _$log_;
1080-
}
1080+
}

src/components/input/input.scss

+5-12
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,6 @@ md-input-container {
219219
overflow: hidden;
220220
@include rtl(clear, left, right);
221221

222-
&.ng-enter {
223-
// Upon entering the DOM, messages should be hidden
224-
.md-input-message-animation {
225-
opacity: 0;
226-
margin-top: -100px;
227-
}
228-
}
229222
}
230223

231224
.md-input-message-animation, .md-char-counter {
@@ -259,16 +252,16 @@ md-input-container {
259252
}
260253
}
261254

262-
// Note: This is a workaround to fix an ng-enter flicker bug
263255
.md-input-message-animation {
264-
&:not(.ng-animate) {
256+
// Enter animation
257+
// Pre-animation state is transparent and off target
258+
&.ng-enter-prepare {
265259
opacity: 0;
266260
margin-top: -100px;
267261
}
268-
}
269262

270-
.md-input-message-animation {
271-
&.ng-enter {
263+
// First keyframe of entry animation
264+
&.ng-enter:not(.ng-enter-active) {
272265
opacity: 0;
273266
margin-top: -100px;
274267
}

0 commit comments

Comments
 (0)