NativeScript / nativescript-angular

Integrating NativeScript with Angular
http://docs.nativescript.org/angular/tutorial/ng-chapter-0
Apache License 2.0
1.22k stars 241 forks source link

RadListView / tkListItemTemplate index doesn't update when ObservableArray changes #2332

Open csimpi opened 3 years ago

csimpi commented 3 years ago

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

Describe the bug

Using RadListView with ObservableArray when I change the array, the index won't follow the changes. Everything else works as expected.

To Reproduce

The bug is 100% reproducible using this sample: https://play.nativescript.org/?template=play-ng&id=sbm9Rh&v=3

  1. Tap on the items, the appearing text should match.
  2. Delete: Item 3 by clicking X
  3. Tap on Item 4 or Item 5, the appearing text won't match.

Expected behavior

When the ObservableArray changes, the index should represent the belonging item.

Sample project

https://play.nativescript.org/?template=play-ng&id=sbm9Rh&v=3

Additional context