bug(material/tree): node added with insertNode remains visible after dataSource is updated
- 主要语言
- TypeScript
- 星标
- 25k
- 派生
- 6.8k
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 91
描述
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
I'm using Material Tree and `insertNode` method to create a node inside the tree menu.
### Reproduction
[StackBlitz link]( https://stackblitz.com/edit/eksxnj-u1duzq?file=src%2Fexample%2Ftree-dynamic-example.html)
Steps to reproduce:
1. Open the app and focus inside the document
2. Press `a` to add a new node using `insertNode` method
3. Press `r` to restore the data to the initial state.
### Expected Behavior
I expect that when the `data` object is populated, only the nodes passed in this array should be on the interface.
### Actual Behavior
A ghost node is added.
### Environment
```sh
@angular-devkit/architect 0.1703.7
@angular-devkit/build-angular 17.3.7
@angular-devkit/core 17.3.7
@angular-devkit/schematics 17.3.7
@angular/cli 17.3.7
@schematics/angular 17.3.7
ng-packagr 17.3.0
rxjs 7.8.1
typescript 5.4.5
webpack 5.90.3
zone.js 0.14.5
```
This is also in v18.
贡献指南
调研方向
从 src/example/tree-dynamic-example.html 中链接的 StackBlitz 复现开始,并重现以下序列:按下 `a` 调用 insertNode,然后按下 `r` 恢复初始数据。跟踪 Material Tree 在插入后如何处理数据更新;完成的标准是只有恢复后的数据数组中的节点保持可见,不存在幽灵节点。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, typescript
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 38/100