SIGN IN SIGN UP
angular / angular.js UNCLAIMED

AngularJS - HTML enhanced for web apps!

0 0 0 JavaScript

fix(ngAnimate): remove event listeners only after all listeners have been called

The fix for removing the event callbacks on destroy introduced in
ce7f400011e1e2e1b9316f18ce87b87b79d878b4 removed the events too early, so that the event callbacks
for the "close" phase in "leave" animations were not called.

This commit fixes the behavior so that the event callbacks are only removed during on('$destroy')
when no animation is currently active on the element. When an animation is active, the event callbacks
will be removed after all callbacks have run, and if the element has no parent (has been removed from
the DOM).

Closes #14321
M
Martin Staffa committed
f8e6a4bcba33e70c0d09cfedd17be628af33c206
Parent: ea4120b