NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.87k stars 3.94k forks source link

About the usage of tree-view trackBy attribute #7118

Closed lycHub closed 2 years ago

lycHub commented 2 years ago

Reproduction link

https://stackblitz.com/edit/angular-xdjeqe?file=src/app/app.component.ts

Steps to reproduce

Click the remove button at the top to delete the last node

What is expected?

Delete the last node, the arrow of its parent node disappears

What is actually happening?

The arrow of its parent node will not disappear

Environment Info
ng-zorro-antd 12.1.0
Browser edge

In order to prevent washing the entire tree every time, I used the trackBy attribute

plakyda-codefresh commented 2 years ago

@lycHub, @hsuanxyz prepared PR for this issue PR