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

ngAnimate & ngClass - Does not remove a class that is still animating #14582

Closed
@thetrevdev

Description

@thetrevdev

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
http://plnkr.co/edit/wsVFlxSJFCslfV9Hossg?p=preview
When a class is added via ngClass then removed too quickly we end up in a state where still have the class on the element.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
http://plnkr.co/edit/wsVFlxSJFCslfV9Hossg?p=preview
*This is a race condition. This plunker is failing over 90% of the time though,

What is the expected behavior?
The falsy ngClass is removed

What is the motivation / use case for changing the behavior?

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Plnkr was failing in 1.4 -> 1.5.5

Other information (e.g. stacktraces, related issues, suggestions how to fix)
Definitely related to ngAnimate as the issue goes away when its not used.
Likely related to the intermediate animate states. In the plunker above we would see .background-add on the element at the time we try to remove .background
This appears to only happen when the new ngClass state is also adding classes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions