-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
ionicModal performance issue after a collection-repeat #2935
Comments
@rickyk586 can you please share a codepen? |
This issue becomes serious when there are many items (f.ex. 1000) in the list(s) that use(s) collection-repeat. It can freeze the app for several (5-15) seconds, depending on how fast the device is. See also what I posted about the issue here: |
I can confirm that the issue of the freezing/stuck of the Modal is related to collection-repeat and 'resize' event. |
The same issue related to performance for collection-repeat is occurring also each time the keyboard is shown on Android, causing the app freezing for several seconds. (I have about 500 items in the collection-repeat model). |
I guess this problem was introduced with the cached views in beta 14. Moving the binding of the resize event listener in collection-repeat to enter and leave events, should probably fix this. No reason for a collection-repeat to listen for resize events when it's not visible, right? |
@stianjensen yes, you are right.
|
That's it, my app is REALLY slow because of it, when I open a modal it's just like hell! Please, consider this issue <3 |
Checking this out. |
Nice! I want to test it, does Ionitron has some delay to apply the last commit to ionic-bower? |
It should be up now. |
With current nightly, it's not fixed when the collection-repeat is in a tab different from the one that opens the modal. Switch to tab "Modal" click the button, the first time you open the modal, it's very slow. |
A collection repeat listens for a resize event and does a heavy recalculation when it is fired. When a modal is shown, it triggers this resize event:
Because this is a heavy operation, it has performance impacts. The modal is not shown right away because each collection-repeat in the app has to go through it's resize recalculation.
I was able to temporarily fix this by commenting out that line in ionicModal.show(). It did not seem to have any negative side effects.
A possible improvement could be to only have the collection-repeat listen for this event when its view is currently active. That way a modal on another view will not be affected by it (and every other collection-repeat that has been shown in the app).
The text was updated successfully, but these errors were encountered: