Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collection-repeat directive bug on Android 4.1 #1292

Closed
shivanik opened this issue May 7, 2014 · 7 comments
Closed

collection-repeat directive bug on Android 4.1 #1292

shivanik opened this issue May 7, 2014 · 7 comments

Comments

@shivanik
Copy link

shivanik commented May 7, 2014

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

@ajoslin
Copy link
Contributor

ajoslin commented May 9, 2014

I have access to android 4.1 phone now, I will try to reproduce this.

@shivanik
Copy link
Author

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) {
    
  •  if (item && item.element[0].style) {
     this.dataSource.attachItem(item);
     item.element[0].style[ionic.CSS.TRANSFORM] = this.transformString(
       primaryPos, secondaryPos, secondaryPos
    
    @@ -44411,4 +44411,4 @@ IonicModule
    };
    }]);

-})();
\ No newline at end of file
+})();

This is not a proper fix but I don't hit the issue again and again now.

@ajoslin
Copy link
Contributor

ajoslin commented May 21, 2014

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.

@ajoslin
Copy link
Contributor

ajoslin commented May 21, 2014

It just uses the .css() function now, which has built in null checks.

@stellasoft-will
Copy link

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.

@AphexHenry
Copy link

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

@clearride
Copy link

getting this on samsung with android 4.1.2 after adding collection-repeat works well with ng-repeat.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants