Repository navigation
Closed
Labels
Description
Bug Report
Ionic version:
[x] 4.x
Current behavior:
Error in console: Error: template for virtual item was not provided. No items or headers are shown.
Expected behavior:
Should show header and items.
Steps to reproduce:
Related code:
<ion-content>
<ion-virtual-scroll *ngIf="hasLoaded" [items]="programmaOnderdelen" [headerFn]="HeaderFn" approxItemHeight="68px" approxHeaderHeight="30px">
<ion-item-divider *virtualHeader="let header">
{{ header }}
</ion-item-divider>
<ion-item *virtualItem="let po" href="#" (click)=" onHeaderClick(po)" lines="none" >
<ion-avatar category-menu={{po.categorie}}>
<img [src]="po.cat.pict" />
</ion-avatar>
<ion-label>
<div class="topline" [ngStyle]="{color : po.sublocatie.hoofdlocatie.bcolor}">
<span>{{po.aanvangsDt * 1000 | date: "EEE H:mm" }}</span>
<span *ngIf="po.eindDt"> - {{po.eindDt * 1000 | date: "H:mm" }}</span>
<span style="padding-left:10px;">{{po.sublocatie.hoofdlocatie.naam}}</span>
</div>
<div class="titleline">
<span class="title">{{po.titel}}</span>
</div>
</ion-label>
</ion-item>
</ion-virtual-scroll>
</ion-content>
Other information:
In virtual-scroll.js, routine getComponent expects a numeric argument 'type'. But it is called with a string argument being 'item', 'header' or 'footer'. This results in an exception being thrown a line 41.
Ionic info:
Ionic:
ionic (Ionic CLI) : 4.5.0 (C:\Users\henkkelder\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.18
@angular-devkit/build-angular : 0.10.7
@angular-devkit/schematics : 7.1.3
@angular/cli : 7.1.3
@ionic/angular-toolkit : 1.2.0
Cordova:
cordova (Cordova CLI) : 8.1.2 ([email protected])
Cordova Platforms : android 7.1.2, browser 5.0.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.5, (and 18 other plugins)
System:
Android SDK Tools : 26.1.1 (C:\Users\henkkelder\AppData\Local\Android\Sdk)
NodeJS : v8.11.4 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Metadata
Metadata
Assignees
Labels
Type
Fields
No fields configured for issues without a type.
Activity
manucorporat commentedon Dec 13, 2018
was it working in beta.17?
henkkelder commentedon Dec 13, 2018
Yes it was.
Although on IOS the virtualScroller needed a 'manual scroll' to show anything. On Android it worked with some minor glitches.
I have modified getComponent on my own system so the switch checks for the stringvalues and then it works again. I cannot find why the cell.type changed from numeric value to string.
manucorporat commentedon Dec 13, 2018
@henkkelder you are right! it's a bug, i am working in a fix a new tests for angular.
Thanks for the issue report!
fix(angular): virtual-scroll
fix(angular): virtual-scroll (ionic-team#16729)
ionitron-bot commentedon Jan 12, 2019
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.