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 addClass/removeClass potential race condition #5191

@sdcooke

Description

@sdcooke

I'm afraid I've so far been unable to create a simple example of this bug, it does happen every time on a larger codebase.

I have an element:

<div ng-class="{ 'navigating': navigating }"></div>

There are CSS animations on the div (from before ngAnimate) and after upgrading to 1.2.3 (from pre-1.2) and adding ngAnimate when the scope variable navigating changes quickly (~100ms) from false to true to false again the "navigating" class remains on the element. So far I've managed to establish this sequence of events:

  • performAnimation('addClass', 'navigation'...
  • ...
  • performAnimation('removeClass', 'navigation'...
  • ...
  • fireDOMOperation for removeClass
  • afterReflow for addClass runs
  • fireDOMOperation for addClass

I'm hoping this either rings a bell with someone or someone can point me in the right direction for further debugging.

I'm able to workaround this for now by putting a timeout around the scope variable change.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions