collection-repeat directive bug on Android 4.1
I tried this code pen code http://codepen.io/ionic/details/mFygh5on Nexus 4 (android 4.4) as well as on Samsung Galaxy S3 (android 4.1)....on the samsung phone, it seems to hang mid-way during the scroll. IT looks like some kind of bug. You can try cloning it from here: git clone https://gist.github.com/11531038.git
The logs show the following error when the list scroll hangs:
D/CordovaLog(20585): http://code.ionicframework.com/1.0.0-beta.3/js/ionic.bundle.js1: Line 32999 : Uncaught TypeError: Cannot set property 'webkitTransform' of undefined E/Web Console(20585): Uncaught TypeError: Cannot set property 'webkitTransform' of undefined:32999
I have access to android 4.1 phone now, I will try to reproduce this.
Hi, I found that the issue seems to be in IonicModule .factory('$collectionRepeatManager', [..) in the renderItem function where the item.element[0].style seems to be undefined in that case and then it gets Cannot set property 'webkitTransform' of undefined. So, just to work around that issue, I added:
diff --git a/www/lib/ionic/js/ionic.bundle.js b/www/lib/ionic/js/ionic.bundle.js index c5fd018..92cf8c8 100644 --- a/www/lib/ionic/js/ionic.bundle.js +++ b/www/lib/ionic/js/ionic.bundle.js @@ -38269,7 +38269,7 @@ function($rootScope, $timeout) { }, renderItem: function(dataIndex, primaryPos, secondaryPos) { var item = this.dataSource.getItem(dataIndex);
-
if (item) { -
@@ -44411,4 +44411,4 @@ IonicModule }; }]);if (item && item.element[0].style) { this.dataSource.attachItem(item); item.element[0].style[ionic.CSS.TRANSFORM] = this.transformString( primaryPos, secondaryPos, secondaryPos
-})(); \ No newline at end of file +})();
This is not a proper fix but I don't hit the issue again and again now.
Hi @shivanik,
I'm finally getting to this.
I still don't know why this bug is happening, but I will implement some failsafes like you suggest for now.
It just uses the .css() function now, which has built in null checks.
This still exists I have error "ionic.bundle.js: Line 4825 : Uncaught TypeError: Cannot set property 'WebkitTransform' of undefined" on 4.1 android but not 4.4 android.
I got this problem sometime too. The scrolling got disabled. I can't inspect. Is the fix above integrated into the last version of ionic? Thanks
getting this on samsung with android 4.1.2 after adding collection-repeat works well with ng-repeat.