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

ngClass space-delimited class string not being applied correctly when ngAnimate enabled #6957

Closed
timkendrick opened this issue Apr 2, 2014 · 4 comments
Assignees

Comments

@timkendrick
Copy link
Contributor

ngClass seems to have trouble figuring out which old classes to remove if the databinding expression evaluates to string of space-delimited class names with the following format: "before-class [my-dynamic-class] after-class"

This problem only appears when 'ngAnimate' is listed as an app dependency (even if no animations are specified).

It appears this bug was introduced with 1.2.13 (the example works fine if you include AngularJS 1.2.12 instead).


Example here: http://jsfiddle.net/8zs4r/

(all the bullet points are meant to stay the same color as each other – try clicking the button repeatedly and see what happens)

@matsko
Copy link
Contributor

matsko commented Apr 3, 2014

Looking into it. Thanks.

@matsko
Copy link
Contributor

matsko commented Apr 3, 2014

PR is awating :) We should have this ready for tomorrow and it will go into 1.2.16 and 1.3-beta.5.

@timkendrick
Copy link
Contributor Author

Great, thanks for the quick response!

matsko added a commit to matsko/angular.js that referenced this issue Apr 4, 2014
@matsko matsko closed this as completed in 708f2ba Apr 4, 2014
matsko added a commit that referenced this issue Apr 4, 2014
@matsko
Copy link
Contributor

matsko commented Apr 4, 2014

@timkendrick this is fixed now and in master and the 1.2.x branch. Sorry for not making the beta.5 and the 1.2.16 release yesterday. You can access the JS files via snapshot under http://code.angularjs.org/ for the master branch. If you want to use only 1.2.x with this fix then you'll need to clone the repo, install and run grunt package and copy the files from the build directory. The next 1.3 release will be in a week and the next 1.2 release will be in two weeks.

Thanks for pointing out the bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants