Skip to content

Commit

Permalink
fix(dialog, menu, select): ignore transitionEnd event timeouts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ThomasBurleson authored and kennethcachia committed Sep 23, 2015
1 parent 712805b commit 1b40c8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions src/core/util/animate.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,13 @@ function AnimateDomUtils($mdUtil, $$rAF, $q, $timeout, $mdConstant) {
*/
function finished(ev) {
if ( ev && ev.target !== element[0]) return;
element.off($mdConstant.CSS.TRANSITIONEND, finished);

if ( ev ) {

$timeout.cancel(timer);
resolve();

} else {
if ( ev ) $timeout.cancel(timer);
element.off($mdConstant.CSS.TRANSITIONEND, finished);

// Only reject if timeout triggered
reject("waitTransitionEnd() timeout");
// Never reject since ngAnimate may cause timeouts due missed transitionEnd events
resolve();

}
}

});
Expand Down
4 changes: 2 additions & 2 deletions src/core/util/animate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('animate', function() {
});
flush();

expect(expired).toBe(true);
expect(expired).not.toBe(true);
}));

it('using custom timeout duration',inject(function() {
Expand All @@ -38,7 +38,7 @@ describe('animate', function() {
});
flush();

expect(expired).toBe(true);
expect(expired).not.toBe(true);
}));

});
Expand Down

0 comments on commit 1b40c8b

Please sign in to comment.