A few days ago (may 2015), Google Chrome released a new version (43.0.2357.65 m).
With this new version, an ng-grid
feature stopped working:
Symptom:
When I click a row, the row isn't highlighted
After running some tests, I've managed to reproduce the problem from zero:
- Create an angular app that requires ng-grid 2.0.14 and ngAnimate.
- With the old Google Chrome version, the row is correctly highlighted.
With the new version of Google Chrome, the row isn't highlighted (although it is selected)
I've created two plunkers:
Plunkr 1: App without ngAnimate
http://plnkr.co/edit/2pSBX9K0QaeaSihMKnGG?p=preview
When selecting a row, the row is highlighted, regardless Chrome version
Plunkr 2: App WITH ngAnimate
http://plnkr.co/edit/hyRO4fTwglSCL8KCTgHA?p=preview
When selecting a row, the row is highlighted in the old Chrome version, but in the new Chrome version this isn't working!
Also if you check in Plunkr 2 with Chrome Inspector after selecting a row, you can see that the row indeed gets the class .ngRow.selected
(this class makes the row highlighted, by changing its background color) but is Chrome the one who is not visually representing this change (this class acquisition)
How can I solve this? any clues?
Edit:
I've created a third plunkr:
http://plnkr.co/edit/cWMlKEz39n8K52VWH9q8?p=preview
This is a fork of the second plunkr, in which I've disabled animations for every item that doesn't have the class "angular-animate"
in it, ie:
app1.config(['$animateProvider', function($animateProvider){
$animateProvider.classNameFilter(/angular-animate/);
}]);
This works (now rows are highlighted after selection) but if you are using animations in your app, this will mostly break every other animation! like bootstrap-ui modals for example. So, this is not a solution, but an idea: I need to disable animations for ng-grid only. How do I achieve that?
classNameFilter(x)
enables animations for only the items with the class x
in them. Is there a similar function for disabling animations for certain items?
angular-animate
for two reasons:bootstrap ui modals
and the libraryangular toaster
. So I've addedclassNameFilter(/modal|toast/)
, which enables animations for those matched items and disables animations for everything else (ie: ng-grids rows) – Chukar