ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Several collection-repeat on the same template

Open sydneyhenrard opened this issue 11 years ago • 20 comments

Type: bug

Platform: android 4.4 webview

I have a ion-list with several ion-item like that:

<ion-list>
        <ion-item class="item-divider">
            Pending
        </ion-item>
        <ion-item
                collection-repeat="pending in pendings">
            <h2>{{pending}}</h2>
        </ion-item>
        <ion-item class="item-divider">
            Recent
        </ion-item>
        <ion-item class="item-text-wrap"
                  collection-repeat="recent in recents">
            <h2">{{recent}}</h2>
        </ion-item>
</ion-list>

The items are not displayed and I get

Uncaught RangeError: Maximum call stack size exceeded
RepeatController.scrollView.__callback

The error is in the following code:

    scrollView.__callback = function(transformLeft, transformTop, zoom, wasResize) {
      var scrollValue = view.getScrollValue();
      if (renderStartIndex === -1 ||
          scrollValue + view.scrollPrimarySize > renderAfterBoundary ||
          scrollValue < renderBeforeBoundary) {
        render();
      }
   ====>   scrollView.__$callback(transformLeft, transformTop, zoom, wasResize);
    };

Please note that this error occurs with JS Scrolling. If I have only one collection-repeat instead of 2, it's OK.

I also tried one collection-repeat and one ng-repeat with native scrolling and the collection-repeat does not display all the items.

sydneyhenrard avatar May 20 '15 19:05 sydneyhenrard

have the same issue rc3. haven't tried upgrading or usering overflow-scroll="true" yet though.

tbro028 avatar May 20 '15 20:05 tbro028

Collection-repeat does not work with native scrolling. As of 1.0, it will force JS scrolling, but in the earlier RCs it would break collection-repeat.

Collection-repeat heavily manipulates the scrollable area, and does not play well with multiple collection-repeats. To achieve this functionality, nest them inside ion-scroll elements.

perrygovier avatar May 20 '15 20:05 perrygovier

i have same problem, any suggestion? ion-scroll didn't do the trick

LightZam avatar Sep 10 '15 07:09 LightZam

:+1: Same problem

diegobill avatar Mar 20 '16 14:03 diegobill

@lightZam @diegobill What version of ionic are guys seeing this issue with?

jgw96 avatar Mar 21 '16 14:03 jgw96

@jgw96 ionic 1.7.12

diegobill avatar Mar 22 '16 01:03 diegobill

@jgw96 same issue.

rapidtechsolutions avatar Mar 28 '16 05:03 rapidtechsolutions

@jgw96 ionic 1.7.12

LightZam avatar Mar 28 '16 06:03 LightZam

Sorry, would you be able to post the output of ionic info 1.7.12 is the cli version not the version of the framework your using. Sorry should have been more clear!

jgw96 avatar Mar 28 '16 15:03 jgw96

@jgw96

Cordova CLI: 5.3.3 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.1 Ionic Version: 1.2.4 Ionic CLI Version: 1.7.14 Ionic App Lib Version: 0.7.0

rapidtechsolutions avatar Mar 28 '16 18:03 rapidtechsolutions

Same issue when using chrome or an android device... Is there any other way to fix it than replacing the 2nd collection-repeat or both by ng-repeat ?

Dev Environment : Node Version : 4.4.0 Ionic CLI : 1.7.14 Ionic App : 0.7.0 Angular : 1.5.3

Clembl-git avatar May 03 '16 14:05 Clembl-git

+1 same issue here.

Cordova CLI: 6.1.1 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.0 Ionic Version: 1.3.0 Ionic CLI Version: 1.7.14 Ionic App Lib Version: 0.7.0 OS: Distributor ID: LinuxMint Description: Linux Mint 17.2 Rafaela Node Version: v0.12.14

jurajdurajka avatar May 16 '16 10:05 jurajdurajka

How multiple collection-repeats to play with ion-scroll ?

jimior2 avatar May 27 '16 05:05 jimior2

same issue ..

saguilerao avatar Jun 06 '16 20:06 saguilerao

Same here. In my case, I see errors in the console but the elements look smaller than the specified height. @perrygovier When I wrap the collections inside ionic-scroll elements, I don't see anything, not even an error.

miparnisari avatar Jun 07 '16 20:06 miparnisari

Same issue over here to.. Is this a bug or it is out of scope of collection-repeat (It is not met to do this) Do any one have at least tempory fix to this

gaurishrane avatar Jun 16 '16 21:06 gaurishrane

+1

MazzMazz avatar Jul 24 '16 21:07 MazzMazz

You can use ng-repeat instead of collection-repeat where this happens. ng-repeat is not ideal but it is working

MazzMazz avatar Jul 24 '16 21:07 MazzMazz

I have the same problem with only one collection-repeat. appears when i go to another page. but all items are displayed.

Cordova CLI: 6.3.0 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 1.3.1 Ionic CLI Version: 2.0.0-beta.35 Ionic App Lib Version: 2.0.0-beta.19 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v5.12.0 Xcode version: Xcode 7.3 Build version 7D175

@jgw96 =)

pablomaurer avatar Aug 14 '16 19:08 pablomaurer

+1. Now use ng-repeat, but it's slow for >100 records list

Cordova CLI: 6.3.1 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.1 Ionic Framework Version: 1.3.1 Ionic CLI Version: 1.7.16 Ionic App Lib Version: 0.7.3 OS: Distributor ID: Ubuntu Description: Ubuntu 15.04 Node Version: v1.8.4

EduardMalik avatar Sep 28 '16 15:09 EduardMalik