bug(CdkDragDrop): reordering smaller against larger items produce flickering effect
- 主要言語
- 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 using CdkDragDrop for reordering items with different sizes (e.g. width for horizontal orientation) in a container with greater height then of the elements there is a flickering effects. CdkDragDrop moves larger item really quickly from one side to another.
Try to drag "Iron age" over empty space in container against some wider item (e.g. "Early modern period")
Example uses angular 12, but in angular 17 it works the same.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/angular-fhqz1h?file=src%2Fapp%2Fcdk-drag-drop-horizontal-sorting-example.css,src%2Fapp%2Fcdk-drag-drop-horizontal-sorting-example.ts,src%2Fapp%2Fcdk-drag-drop-horizontal-sorting-example.html
### Expected Behavior
Reorder elements without flickering effects, as it is when reordering elements of the same size or when container is not larger (e.g. greater height for horizontal list).
### Actual Behavior
Larger element in the list that is reordered against moves fast from one side to another.
### Environment
- Angular: 12
- CDK/Material: 12
- Browser(s): any
- Operating System (e.g. Windows, macOS, Ubuntu): any
コントリビューションガイド
調査の方向性
まず、リンクされた StackBlitz の再現を実行し、src/app/cdk-drag-drop-horizontal-sorting-example.css、.ts、.html を調べます。「Iron age」を「Early modern period」と対向する空白の上にドラッグして再現し、その後、CdkDragDrop の水平方向の並べ替え動作を追跡します。サイズの異なる項目がちらつきなしに並べ替えられ、同じサイズおよびより短いコンテナの場合の動作と一致すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100