nativescript-ui-feedback icon indicating copy to clipboard operation
nativescript-ui-feedback copied to clipboard

RadListView - undefined item while scrolling

Open timbell opened this issue 4 years ago • 6 comments

Tell us about the problem

RadListView + Angular with grid layout. When scrolling, sometimes the item template is called with an undefined item. I've reproduced in a sample app based on the Hello World template using the current latest NativeScript version (8.0.1) and also in the playground.

The problem appears to be triggered by the presence of cells with different heights, hence the contrived example.

Which platform(s) does your issue occur on?

Platform: Android - Accelerated Nougat emulator, real android 11 and the playground

Please provide the following version numbers that your issue occurs with:

nativescript-ui-listview - 9.1.0 CLI - 8.0.1 @nativescript/core - 8.0.1 nativescript-ui-core - 4.0.0 @nativescript/android - 8.0.0 @angular - 11.2.9

Please tell us how to recreate the issue in as much detail as possible.

To reproduce, start the app and scroll (slowly is best) in the listview. Occasionally an error will appear in the console:

JS: ERROR TypeError: Cannot read property 'text' of undefined

The sample app also records the times that the item is undefined and displays this count in the header.

The problem leads to empty cells being displayed in the grid.

Here's an animated gif showing the problem happening: listview-bug

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

Please see the app in the playground: link

timbell avatar Apr 14 '21 15:04 timbell

Same here :( - occasionally, difficult to reproduce ...

jessorlisa avatar Apr 30 '21 07:04 jessorlisa

@timbell @jessorlisa could you try nativescript-ui-listview 9.0.4?

I also have issues using the RadListView component on Android since version 9.1.0 + https://github.com/ProgressNS/nativescript-ui-feedback/issues/1508

felixkrautschuk avatar Jun 30 '21 13:06 felixkrautschuk

@felixkrautschuk I ended up with a workaround, like item ? item.name : '' - this problem has been occurring since we've been using RadListView, if only occasionally and not properly reproducable.

jessorlisa avatar Jul 01 '21 05:07 jessorlisa

@felixkrautschuk I' do the same as @jessorlisa . It works around the problem satisfactorily.

timbell avatar Jul 01 '21 06:07 timbell

Same issue.

meightythree avatar Apr 28 '22 20:04 meightythree

I also have the same issue

wouter-willems avatar Jun 15 '22 14:06 wouter-willems