question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

virtual-scroll with table row - ionic 4 RC01

See original GitHub issue

Bug Report

Ionic version: [x] 4.x

Current behavior: Virtual Scroll throws an error “TypeError: Cannot read property ‘context’ of undefined” and does not render anything when trying to repeat table rows and data

Expected behavior: Virtual scroll renders list of objects performantly.

Steps to reproduce:

In a page create an array of objects

testArray = [{name:“test1”}, {name:“test2”}, {name:“test3”}]

In the template , populate a row with the following template

<ion-virtual-scroll [items]="testArray">
    <tr *virtualItem="let item">
	<td>{{item.name}}</td>
    </tr>
</ion-virtual-scroll>

If we replace tr tags with ion-item the error disappears and it renders the elements in the DOM but the elements are not visible.

Other information:

Ionic info:

Ionic:
   ionic (Ionic CLI)             : 4.6.0 
   Ionic Framework           : @ionic/angular 4.0.0-rc.1
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.1.4
   @angular/cli                  : 7.1.4
   @ionic/angular-toolkit        : 1.2.2

System:
   NodeJS : v10.15.0 
   npm    : 6.5.0
   OS     : Windows 7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
coffeymattcommented, Mar 22, 2019

I have the same issue with a virtual scroll containing an ion-item-sliding, same stack trace.

4reactions
akiludecommented, Jan 14, 2019

Here is the full error text

TypeError: Cannot read property ‘context’ of undefined at fesm5.js:3778 at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:391) at Object.onInvoke (core.js:16156) at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invoke (zone.js:390) at Zone.push…/node_modules/zone.js/dist/zone.js.Zone.run (zone.js:150) at NgZone.push…/node_modules/@angular/core/fesm5/core.js.NgZone.run (core.js:16070) at IonVirtualScroll.push…/node_modules/@ionic/angular/dist/fesm5.js.IonVirtualScroll.nodeRender (fesm5.js:3767) at doRender (ffukzwt6.entry.js:1) at t.writeVS (ffukzwt6.entry.js:1) at p (ionic.core.js:9)

Read more comments on GitHub >

github_iconTop Results From Across the Web

virtual-scroll with table row - ionic 4 RC01 · Issue #17095
Expected behavior: Virtual scroll renders list of objects performantly. ... If we replace tr tags with ion-item the error disappears and it ...
Read more >
ion-virtual-scroll
Virtual Scroll displays a virtual, "infinite" list. An array of records is passed to the virtual scroll containing the data to create templates...
Read more >
Ionic 4 Columns with ion-virtual-scroll not working
It won't work with Virtual Scroll. Virtual Scroll was made to render just the items visible on screen, so, virtual items should have ......
Read more >
Making an Angular Material data table rows scroll while ...
Coding example for the question Making an Angular Material data table rows scroll while maintaining a sticky a header-angular.js.
Read more >
Faster List Performance with Ionic 4 Virtual Scroll & Infinite Scroll
In this tutorial we increase our Ionic 4 list performance with the virtual scroll and infinite scroll component! Learn to build mobile apps ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found