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

Fix for #12266 : Fixed skipping/cleaning of elements pending animations. #12277

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/ngAnimate/animateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,9 @@ var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
// method which will call the runner methods in async.
existingAnimation.close();
} else {
// this will merge the existing animation options into this new follow-up animation
mergeAnimationOptions(element, newAnimation.options, existingAnimation.options);
// this will merge the new animation options into existing animation options
mergeAnimationOptions(element, existingAnimation.options, newAnimation.options);
return existingAnimation.runner;
}
} else {
// a joined animation means that this animation will take over the existing one
Expand Down
18 changes: 18 additions & 0 deletions test/ngAnimate/animateSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,24 @@ describe("animations", function() {
expect(r1).toBe(r2);
expect(r2).toBe(r3);
}));

it('should not skip or miss the animations when animations are executed sequential',
inject(function($animate, $rootScope, $$rAF, $rootElement) {

element = jqLite('<div></div>');

$rootElement.append(element);

$animate.addClass(element, 'rclass');
$animate.removeClass(element, 'rclass');
$animate.addClass(element, 'rclass');
$animate.removeClass(element, 'rclass');

$rootScope.$digest();
$$rAF.flush();

expect(element).not.toHaveClass('rclass');
}));
});
});

Expand Down