Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(angular/virtual-scroll) trackByFn don't effect to render #21754

Closed
rdlabo opened this issue Jul 15, 2020 · 2 comments
Closed

bug(angular/virtual-scroll) trackByFn don't effect to render #21754

rdlabo opened this issue Jul 15, 2020 · 2 comments
Labels

Comments

@rdlabo
Copy link
Contributor

rdlabo commented Jul 15, 2020

Bug Report

Ionic version:

[ ] 4.x
[x] 5.x

Current behavior:
trackByFn don't effect to rendering. We expand this line will effect to nodeRender method:
https://github.com/ionic-team/ionic-framework/blob/master/angular/src/directives/virtual-scroll/virtual-scroll.ts#L172-L175

Expected behavior:
trackByFn must effect to rendering. Diff patten handle rendering pattern like Angular ngFor:
https://github.com/angular/angular/blob/master/packages/common/src/directives/ng_for_of.ts#L229-L246

Steps to reproduce:

  1. use Array Object in ion-virtual-scroll with trackByFn
  2. overwrite Array Object
  3. All arrays are rerender

Related code:
https://stackblitz.com/edit/ionic-v4-angular-tabs-4ehr1o

Other information:
This continues to occur from Ionic4.

Ionic info:

Ionic:

   Ionic CLI                     : 6.10.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.2.3
   @angular-devkit/build-angular : 0.1000.1
   @angular-devkit/schematics    : 10.0.1
   @angular/cli                  : 10.0.1
   @ionic/angular-toolkit        : 2.2.0

Capacitor:

   Capacitor CLI   : 2.2.0
   @capacitor/core : 2.2.0

Utility:

   cordova-res (update available: 0.15.1) : 0.11.0
   native-run                             : not installed

System:

   NodeJS : v12.16.2 (/usr/local/bin/node)
   npm    : 6.14.4
   OS     : macOS Catalina
@ionitron-bot ionitron-bot bot added the triage label Jul 15, 2020
@rdlabo
Copy link
Contributor Author

rdlabo commented Jul 15, 2020

This is same #17540

@rdlabo rdlabo closed this as completed Jul 15, 2020
@ionitron-bot
Copy link

ionitron-bot bot commented Aug 14, 2020

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Aug 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant