Hi all ,
I am working with Ionic for along time and made most of my applications with Ionic 3 framework.
Now I am developing an application for image selection.
In this application I have a list of tabs. each tab is a alum library on the device.
And the first tab is for a list of all images from all albums.
So when a user clicks on a tab I show a virtualScroll list with a grid of the images in that tab the images are taken from the device.
The problem is that when I scroll/swipe quickly up and and down I see a white area for a 1-3 seconds and only after that I see the images.
I am stuck with this problem for a week now !
What is the problem with that and how can I fix it?
You can see a demonstration of what I am talkink about in this screen video I made
https://www.youtube.com/watch?v=CsacKtyKcpA
And a screen shot:
Here is my HTML code for showing the images:
<ion-header>
<ion-navbar>
<ion-title>images: {{pageTitle}}</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<div class="wrapper-div">
<ion-grid [virtualScroll]="albumImages" [approxItemHeight]="'100px'" bufferRatio="5">
<ion-row>
<ion-col col-4 *virtualItem="let image">
<div class="image" [style.height.px]="imageHeight">
<img-loader [src]="image.url" useImg></img-loader>
</div>
</ion-col>
</ion-row>
</ion-grid>
</div>
</ion-content>
No answers from Ionic team ?
Any one else maybe ?
So the question is:
Is virtualScroll broken ?
See this post:
I was never able to find a solution. I dug through stack overflow and asked on other forums with no avail.
It appears that all the other issues relating to virtual scroll essentially came down to “virtual scroll is broken.” or “use infinite scroll” which doesn’t work for my needs… Not really what I wanted to here but I gave up after It seemed that the ionic team was ignoring git issues regarding virtual scroll… or they just flat out closed issues that were unresolved.
And if so will Ionic team fix it for Ionic 3?
It seams that also on Ionic 4 it is not working for ion-grid
See this issue:
opened 09:25AM - 29 Nov 18 UTC
triage
_Original issue by @gordyr on [2018-07-10T13:21:23Z](https://github.com/ionic-te… am/ionic/issues/14744)_
# Bug Report
**Ionic Info**
Run `ionic info` from a terminal/cmd prompt and paste the output below.
```
Ionic:
ionic (Ionic CLI) : 4.0.0-rc.10 (C:\Users\Gordy\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.0-alpha.7
@angular-devkit/core : 0.7.0-rc.0
@angular-devkit/schematics : 0.7.0-rc.0
@angular/cli : 6.0.8
@ionic/ng-toolkit : 1.0.0-rc.9
@ionic/schematics-angular : 1.0.0-rc.9
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
System:
NodeJS : v9.1.0 (C:\Program Files\nodejs\node.exe)
npm : 6.1.0
OS : Windows 10
Environment:
ANDROID_HOME : not set
```
**Describe the Bug**
Virtual scrolling no longer appears to work with a grid.
In Ionic 3.9.2 applying a virtual scroller to a grid was simple:
```
<ion-grid approxItemHeight="{{itemHeight}}px" [virtualScroll]="items"
<ion-row>
<ion-col *virtualItem="let item">
<graph [item]="item"></graph>
</ion-col>
</ion-row>
</ion-grid>
```
In version 4, this doesn't appear to be possible. You can no longer use an ```<ion-grid>``` as the root scroller as it has to be an ```<ion-virtual-scroll>``` element, and even width explicit widths and heights set to each individual element, I cannot get the elements to layout horizontally, in a grid/column like fashion, at all.
Is there a new method of laying out the items in say 3 or 4 columns with the new virtual scroller? Or is that functionality no longer present?
Still waiting for some response from Ionic team …