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

Nz Tags Not working properly with ngFor trackBy with nzOnClose #4581

Closed
vatsalpande opened this issue Dec 20, 2019 · 3 comments
Closed

Nz Tags Not working properly with ngFor trackBy with nzOnClose #4581

vatsalpande opened this issue Dec 20, 2019 · 3 comments
Assignees

Comments

@vatsalpande
Copy link

vatsalpande commented Dec 20, 2019

Reproduction link

https://stackblitz.com/edit/angular-znfrjs

Steps to reproduce

There is a list of checkboxes and selected values are shown in tags

  1. Select values from checkbox. It will appear as tag.
  2. Close tag. It removes extra tags
  3. Disable trackBy from app.component.html and it will work as expected

What is expected?

It should work seamlessly with trackBy operator. Without using trackBy, there is a lot of flickering on the screen which doesn't give good UX.
Resultset is also shown on top of tags for debugging

What is actually happening?

when trackBy is enabled, on closing tag, it is not rendering list of tags properly and is removing tags that should be shown

Environment Info
ng-zorro-antd 8.1.2
Browser Chrome
@vatsalpande
Copy link
Author

Hi,
Did you get a chance to take a look at this issue? Appreciate your help on this.

@hsuanxyz
Copy link
Member

hsuanxyz commented Jan 6, 2020

@vatsalpande

The Angular animation has a bug angular/angular#24041, it caused the animation can not execute.

This is a temporary solution:

<nz-tag *ngFor="let combination of selectedCombination;" 
        class="tag"
        nzMode="closeable"
        nzNoAnimation
        (nzOnClose)="selectFilter(combination)">
  {{combination.label}}
</nz-tag>

Use the nzNoAnimation directive to prevent flickering.

@hsuanxyz hsuanxyz added 🤚 Blocked By @angular ❓ FAQ Frequently asked questions. labels Jan 6, 2020
@vatsalpande
Copy link
Author

@hsuanxyz - The proposed temp solution works. Thank you. If possible, please update this ticket once we have a permanent fix so I can apply that,

@hsuanxyz hsuanxyz mentioned this issue Sep 9, 2020
48 tasks
vthinkxie pushed a commit to vthinkxie/ng-zorro-antd that referenced this issue Sep 17, 2020
close NG-ZORRO#5628 close NG-ZORRO#4581
BREAK CHANGES: '(nzAfterClose)' Output is going to be removed in 9.0.0. Please use '(nzOnClose)' instead.
vthinkxie pushed a commit to vthinkxie/ng-zorro-antd that referenced this issue Sep 17, 2020
close NG-ZORRO#5628 close NG-ZORRO#4581
BREAK CHANGES: '(nzAfterClose)' Output is going to be removed in 9.0.0. Please use '(nzOnClose)' instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants