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

bug: Collection-Repeat with Caching and Modals causes app to crash in beta 14 #2879

Closed
rajatrocks opened this issue Jan 6, 2015 · 6 comments

Comments

@rajatrocks
Copy link

Type: bug

Platform: all

- Home tab has a collection-repeat list in it. Each element has a picture. - A second tab has a button to open a modal. - When the modal is shown, it calls ionic.trigger('resize'); _(line 2955 of ionic-angular.js)_ - The collection-repeat on the home tab (which is cached as of b14) listens to this, calls collectionRepeatManager.resize() which then renders **all the non-showing elements** in the list. If there are pictures, **all the pictures are loaded**. And when run on device, the app likely crashes with an out of memory error. - Turning off cache for the Home tab eliminates the problem. - Removing collection-repeat eliminates the problem. - Commenting out the call to ionic.trigger('resize') eliminates the problem (for me).

Codepen here: http://codepen.io/rajatrocks/pen/myOYLw

Discussion here: http://forum.ionicframework.com/t/collection-repeat-and-view-cache-weirdness/14651

@rajatrocks rajatrocks changed the title bug: Collection-Repeat with Caching and Modals causes app to crash in beta 14 bug: bug: Collection-Repeat with Caching and Modals causes app to crash in beta 14 Jan 6, 2015
@rajatrocks rajatrocks changed the title bug: bug: Collection-Repeat with Caching and Modals causes app to crash in beta 14 bug: Collection-Repeat with Caching and Modals causes app to crash in beta 14 Jan 6, 2015
@felquis
Copy link

felquis commented Jan 7, 2015

Probably related to #2890

@miklernout
Copy link

+1

@ajoslin
Copy link
Contributor

ajoslin commented Feb 24, 2015

Fixed via bb866da

@ajoslin ajoslin closed this as completed Feb 24, 2015
@ajoslin
Copy link
Contributor

ajoslin commented Feb 24, 2015

In short, the modal sends a resize event.

The old collection repeat would recalculate everything on the resize event.

The new collection repeat only recalculates on resize if the collection repeat is in view, and also doesn't recalculate everything anymore. It only recalculates what has to be recalculated on resize - up to the current scroll value.

@ajoslin
Copy link
Contributor

ajoslin commented Feb 24, 2015

Or in the case of your codepen, nothing needs to be recalculated anymore since it uses static item heights...

@ajoslin
Copy link
Contributor

ajoslin commented Feb 24, 2015

Latest nightly, you don't need item-height and item-width attributes anymore: http://codepen.io/anon/pen/wBjYJo

If you don't supply width/height, it will getComputedStyle() of the first element and use that for the width/height of every element.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 6, 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