ionic-team / ionic-v3

The repo for Ionic 3.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
127 stars 85 forks source link

The virtualScroll does not work when using the segments #107

Open jma-9code opened 8 years ago

jma-9code commented 8 years ago

This code doesn't work...the ion-item isn't showed by the ionic framework.

Code to reproduce :

<ion-content>
    <div [ngSwitch]="curSegment">
        <ion-list [virtualScroll]="items" [approxItemHeight]=" '100px' " *ngSwitchCase="'test'">
            <ion-item *virtualItem="let item" text-wrap>
                <ion-avatar item-left>
                       <ion-img [src]="item.avatar"></ion-img>
                </ion-avatar>
                <h2>{{item.name}}</h2>
            </ion-item>
        </ion-list>
        ...
</ion-content>

If the "ion-list" is before the <div [ngSwitch]>, then is showed. Ionic 2b10 used.

jgw96 commented 8 years ago

Hello, thanks for opening an issue with us! Would you be able to provide a plunker that demonstrates this issue? Thanks for using Ionic!

jma-9code commented 8 years ago

Hi,

http://plnkr.co/edit/KI11iO?p=preview

flackdl commented 7 years ago

I am seeing the same symptoms on RC3. I have noticed that it works fine as long as the virtualScroll element isn't nested within any other directives (ngIf, ngSwitch etc). Similar to https://github.com/driftyco/ionic/issues/7734

HugoHeneault commented 7 years ago

I opened a PR https://github.com/ionic-team/ionic/pull/13406 which should fix the problem here. Please try it and tell me if it's working :)

TechWatching commented 6 years ago

I was hoping for your PR to be merged but it seems that it has just been closed :(. It's too bad as it seems that we are quite a few to encounter the issues your PR solves.

ionitron-bot[bot] commented 6 years ago

Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

Thank you for using Ionic!