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

Commit ce46a9a

Browse files
fix(dialog, menu, select): ignore transitionEnd event timeouts
due to conflicts with ngAnimate 1.4.x, temporarily ignore transitionEnd event timeouts. v0.11 will provide complete solution set to replace this interim solution.
1 parent 9ce97c5 commit ce46a9a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/core/util/animate.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,13 @@ function AnimateDomUtils($mdUtil, $$rAF, $q, $timeout, $mdConstant) {
6666
*/
6767
function finished(ev) {
6868
if ( ev && ev.target !== element[0]) return;
69-
element.off($mdConstant.CSS.TRANSITIONEND, finished);
70-
71-
if ( ev ) {
7269

73-
$timeout.cancel(timer);
74-
resolve();
75-
76-
} else {
70+
if ( ev ) $timeout.cancel(timer);
71+
element.off($mdConstant.CSS.TRANSITIONEND, finished);
7772

78-
// Only reject if timeout triggered
79-
reject("waitTransitionEnd() timeout");
73+
// Never reject since ngAnimate may cause timeouts due missed transitionEnd events
74+
resolve();
8075

81-
}
8276
}
8377

8478
});

src/core/util/animate.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('animate', function() {
2424
});
2525
flush();
2626

27-
expect(expired).toBe(true);
27+
expect(expired).not.toBe(true);
2828
}));
2929

3030
it('using custom timeout duration',inject(function() {
@@ -38,7 +38,7 @@ describe('animate', function() {
3838
});
3939
flush();
4040

41-
expect(expired).toBe(true);
41+
expect(expired).not.toBe(true);
4242
}));
4343

4444
});

0 commit comments

Comments
 (0)