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

Not working with Ionic content scroll, when using ng-lazyload-image inside ion-virtual-scroll #511

Open
Coder7777 opened this issue May 13, 2021 · 1 comment

Comments

@Coder7777
Copy link

Coder7777 commented May 13, 2021

  <ion-content>
    <ion-virtual-scroll #container [items]="images" approxItemHeight="320px">
      <ion-card *virtualItem="let image; let itemBounds = bounds;let i=index;">
        <div>
          <img [defaultImage]="test" [lazyLoad]="image" [errorImage]="def" />
        </div>
        <ion-card-header>
          <ion-card-title>Index{{i}}</ion-card-title>
        </ion-card-header>
        <ion-card-content>Index{{i}}</ion-card-content>
      </ion-card>
    </ion-virtual-scroll>
  </ion-content> 

whatever scroll, the image always only show the [defaultImage]

@Coder7777
Copy link
Author

Coder7777 commented May 13, 2021

 <ion-content  [scrollEvents]=true #container>
      ...
          <img [defaultImage]="test" [lazyLoad]="image" [errorImage]="def" [customObservable]="container.ionScroll"/>
      ...
</ion-content>

the scroll event only can be emitted, when ion-content set [scrollEvents]=true.

Ionic 5 disabled ion-content scroll event, it's different from the previous version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant