angular / angular/components

bug(Virtual scrolling + Signals): When removing an element from the array it is not removed from the screen

オープン
#27,291 コメント 2 件 リアクション 6 件 担当者 0 名 GitHub で見る
area: cdk/scrolling P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
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

When trying to use Virtual Scrolling with Signals when removing element, it is not removed from the screen. The bug only occurs using `*cdkVirtualFor`. If you use `*ngFor` the element is removed correctly.

### Reproduction

Ex:

HTML:
```



```

TS:
```
export type OrderColumn = { orders: Order[], total: number, page: number };
orderColumn: Signal;

```

### Expected Behavior

I expected that when removing an element from the orderColumn().orders array it would exit the screen.

### Actual Behavior

When removing an element, it continues to be rendered on screen.

### Environment

```
Angular CLI: 16.0.5
Node: 18.12.1
Package Manager: npm 8.19.2
OS: win32 x64

Angular: 16.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1600.5
@angular-devkit/build-angular 16.0.5
@angular-devkit/core 16.0.5
@angular-devkit/schematics 16.0.5
@angular/cdk 16.0.4
@angular/material 16.0.4
@schematics/angular 16.0.5
rxjs 7.5.7
typescript 5.0.4
````

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、提供された Angular テンプレートで *cdkVirtualFor、Signals、orderColumn().orders からの削除を使用して問題を再現し、その後 *ngFor と比較します。仮想スクロールの更新経路を追跡し、要素を削除すると対応するレンダリング済みアイテムが画面から外れることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。